Class OptionService
- Namespace
- Dynamicweb.Forms
- Assembly
- Dynamicweb.Forms.dll
public abstract class OptionService
- Inheritance
-
OptionService
- Inherited Members
Methods
AttachToField(int, IEnumerable<Option>)
Attaches the given Options to a field.
public virtual void AttachToField(int fieldId, IEnumerable<Option> options)
Parameters
fieldIdintThe field identifier.
optionsIEnumerable<Option>The options to attach to the field.
Copy(Option, int)
Copies the given Option to the field with the given identifier.
public virtual void Copy(Option fieldOption, int destinationFieldId)
Parameters
Delete(IEnumerable<int>)
Deletes the options matching the specified IDs.
public virtual void Delete(IEnumerable<int> optionIds)
Parameters
optionIdsIEnumerable<int>The IDs of the options to delete.
Delete(int)
Deletes the Option with the given identifier.
public virtual void Delete(int optionId)
Parameters
optionIdintThe option identifier.
DeleteByFieldId(int)
Deletes all Options belonging to the field with the given identifier.
public virtual void DeleteByFieldId(int fieldId)
Parameters
fieldIdintThe field identifier.
GetAll()
Get all options.
public virtual IEnumerable<Option> GetAll()
Returns
GetById(int)
Get an option by ID.
public virtual Option? GetById(int optionId)
Parameters
optionIdintThe option identifier.
Returns
- Option
The option, or
nullif not found.
GetOptions(int)
Get options belonging to a field.
public virtual IEnumerable<Option> GetOptions(int fieldId)
Parameters
fieldIdintThe field identifier.
Returns
Save(Option)
Saves or updates the given Option.
public virtual void Save(Option fieldOption)
Parameters
SortDown(Option)
Sorts down.
public virtual void SortDown(Option fieldOption)
Parameters
SortOptions(int, IEnumerable<Option>)
Sorts all the options on a field.
public virtual void SortOptions(int fieldId, IEnumerable<Option> orderedOptions)
Parameters
fieldIdintThe Field ID.
orderedOptionsIEnumerable<Option>A collection of options defining the new order: Sort.
SortUp(Option)
Sorts up.
public virtual void SortUp(Option fieldOption)
Parameters
ToggleActive(int)
Toggles the value of Active.
public virtual void ToggleActive(int optionId)
Parameters
optionIdintThe option identifier.
ToggleDefault(int)
Toggles the value of DefaultSelected.
public virtual void ToggleDefault(int optionId)
Parameters
optionIdintThe option identifier.