Class FormFieldService
- Namespace
- Dynamicweb.Forms
- Assembly
- Dynamicweb.Forms.dll
public abstract class FormFieldService
- Inheritance
-
FormFieldService
- Inherited Members
Methods
Copy(Field, int, bool)
Copies the specified field to a destination form identifier.
public virtual void Copy(Field field, int destinationFormId, bool keepFieldName)
Parameters
fieldFieldThe field to copy.
destinationFormIdintTo form identifier.
keepFieldNameboolif set to
true[keep name].
Delete(Field)
Deletes the specified field.
public virtual void Delete(Field field)
Parameters
fieldFieldThe field to delete.
Delete(IEnumerable<int>)
Deletes the fields matching the specified IDs.
public virtual void Delete(IEnumerable<int> fieldIds)
Parameters
fieldIdsIEnumerable<int>The IDs of the fields to delete.
Delete(int)
Deletes the field matching the specified ID.
public virtual void Delete(int fieldId)
Parameters
fieldIdintThe ID of the field to delete.
GetAll()
Get the all fields.
public virtual IEnumerable<Field> GetAll()
Returns
GetById(int)
Get a form field by ID.
public virtual Field? GetById(int fieldId)
Parameters
fieldIdintThe ID of the form field.
Returns
GetByIds(IEnumerable<int>)
Get form fields by IDs.
public virtual IEnumerable<Field> GetByIds(IEnumerable<int> fieldIds)
Parameters
fieldIdsIEnumerable<int>The IDs of the form fields.
Returns
GetFormFields(Form)
Get fields for a given form.
public virtual IEnumerable<Field> GetFormFields(Form form)
Parameters
formFormThe form.
Returns
GetFormFields(int)
Get fields for the form with the specified ID.
public virtual IEnumerable<Field> GetFormFields(int formId)
Parameters
formIdintThe ID of the form.
Returns
MoveFieldsUp(int, int)
Moves the fields up.
public virtual void MoveFieldsUp(int formId, int fromSort)
Parameters
Save(Field)
Saves the specified field.
public virtual void Save(Field field)
Parameters
fieldFieldThe field to save.
SortDown(Field)
Sorts the field down.
public virtual void SortDown(Field field)
Parameters
fieldFieldThe field to sort down.
SortOptions(Field, bool, Func<Option, string>)
Sorts the options of the field by the given method.
public virtual void SortOptions(Field field, bool descending, Func<Option, string> methodDelegate)
Parameters
fieldFieldThe field.
descendingboolProvide
trueif sorting should be descending, otherwise it will be sorted ascending.methodDelegateFunc<Option, string>The method selector to indicate what property it should sort by.
SortOptions(int, bool, Func<Option, string>)
Sorts the options of the field by the given method.
public virtual void SortOptions(int fieldId, bool descending, Func<Option, string> methodDelegate)
Parameters
fieldIdintThe field identifier.
descendingboolProvide
trueif sorting should be descending, otherwise it will be sorted ascending.methodDelegateFunc<Option, string>The method selector to indicate what property it should sort by.
SortUp(Field)
Sorts the field up.
public virtual void SortUp(Field field)
Parameters
fieldFieldThe field to sort up.
ToggleActive(int)
Toggles the active.
public virtual void ToggleActive(int fieldId)
Parameters
fieldIdintThe field identifier.
ToggleRequired(int)
Toggles the required.
public virtual void ToggleRequired(int fieldId)
Parameters
fieldIdintThe field identifier.