Table of Contents

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 int

The 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

fieldOption Option

The Option to copy.

destinationFieldId int

The destination field identifier.

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 int

The option identifier.

DeleteByFieldId(int)

Deletes all Options belonging to the field with the given identifier.

public virtual void DeleteByFieldId(int fieldId)

Parameters

fieldId int

The field identifier.

GetAll()

Get all options.

public virtual IEnumerable<Option> GetAll()

Returns

IEnumerable<Option>

GetById(int)

Get an option by ID.

public virtual Option GetById(int optionId)

Parameters

optionId int

The 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 int

The field identifier.

Returns

IEnumerable<Option>

Save(Option)

Saves or updates the given Option.

public virtual void Save(Option fieldOption)

Parameters

fieldOption Option

The Option to save or update.

SortDown(Option)

Sorts down.

public virtual void SortDown(Option fieldOption)

Parameters

fieldOption Option

The Option to sort down.

SortUp(Option)

Sorts up.

public virtual void SortUp(Option fieldOption)

Parameters

fieldOption Option

The Option to sort up.

ToggleActive(int)

Toggles the value of Active.

public virtual void ToggleActive(int optionId)

Parameters

optionId int

The option identifier.

ToggleDefault(int)

Toggles the value of DefaultSelected.

public virtual void ToggleDefault(int optionId)

Parameters

optionId int

The option identifier.

To top