Class OptionService
- Namespace
- Dynamicweb.Forms
- Assembly
- Dynamicweb.Forms.dll
public abstract class OptionService
- Inheritance
-
OptionService
- Derived
- Inherited Members
Methods
AttachToField(int, IEnumerable<Option>)
Attaches the given Options to a field.
public virtual void AttachToField(int fieldId, IEnumerable<Option> options)
Parameters
fieldId
intThe field identifier.
options
IEnumerable<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
optionIds
IEnumerable<int>The IDs of the options to delete.
Delete(int)
Deletes the Option with the given identifier.
public virtual void Delete(int optionId)
Parameters
optionId
intThe option identifier.
DeleteByFieldId(int)
Deletes all Options belonging to the field with the given identifier.
public virtual void DeleteByFieldId(int fieldId)
Parameters
fieldId
intThe 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
optionId
intThe option identifier.
Returns
- Option
The option, or
null
if not found.
GetOptions(int)
Get options belonging to a field.
public virtual IEnumerable<Option> GetOptions(int fieldId)
Parameters
fieldId
intThe 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
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
optionId
intThe option identifier.
ToggleDefault(int)
Toggles the value of DefaultSelected.
public virtual void ToggleDefault(int optionId)
Parameters
optionId
intThe option identifier.