Class DisplayOptions
Service that is used to register DisplayOptions
Inheritance
Inherited Members
Namespace: EPiServer.Web
Assembly: EPiServer.dll
Version: 10.10.4Syntax
[ServiceConfiguration(typeof(DisplayOptions), Lifecycle = ServiceInstanceScope.Singleton)]
public class DisplayOptions : IEnumerable<DisplayOption>, IEnumerable, IInitializableModule
Remarks
Display options are returned in the order they were added when enumerating over this class.
Constructors
DisplayOptions()
Initializes a new instance of the DisplayOptions class.
Declaration
public DisplayOptions()
Methods
Add(DisplayOption)
Add a display option
Declaration
public virtual DisplayOptions Add(DisplayOption displayOption)
Parameters
Type | Name | Description |
---|---|---|
DisplayOption | displayOption | The display option to add |
Returns
Type | Description |
---|---|
DisplayOptions |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if the display options is null |
System.ArgumentException | A display option with the same id allready exists |
Add(String, String, String)
Add a new display option
Declaration
public virtual DisplayOptions Add(string id, string name, string tag)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Unique identifier for the option |
System.String | name | Name of the display option to add, if a language resource key is specified it will be automatically translated |
System.String | tag | The template tag to apply when the option has been selected |
Returns
Type | Description |
---|---|
DisplayOptions |
Add(String, String, String, String)
Add a new display option
Declaration
public virtual DisplayOptions Add(string id, string name, string tag, string description)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Unique identifier for the option |
System.String | name | Name of the display option to add, if a language resource key is specified it will be automatically translated |
System.String | tag | The rendering tag to apply when the option has been selected |
System.String | description | Description for the option |
Returns
Type | Description |
---|---|
DisplayOptions |
Add(String, String, String, String, String)
Add a new display option
Declaration
public virtual DisplayOptions Add(string id, string name, string tag, string description, string iconClass)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Unique identifier for the option |
System.String | name | Name of the display option to add, if a language resource key is specified it will be automatically translated |
System.String | tag | The rendering tag to apply when the option has been selected |
System.String | description | Description for the option |
System.String | iconClass | Css class for the icon that is used in the display option selector |
Returns
Type | Description |
---|---|
DisplayOptions |
Get(String)
Gets the display options with the specified id
Declaration
public virtual DisplayOption Get(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The id if the option to get. |
Returns
Type | Description |
---|---|
DisplayOption | DisplayOption or null |
GetEnumerator()
Declaration
public IEnumerator<DisplayOption> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<DisplayOption> |
Initialize(ITypeScannerLookup, IServiceLocator)
Initializes a new instance of the DisplayOptions class.
Declaration
[Obsolete("Initialize by retreving instances from scanner and call add")]
protected virtual void Initialize(ITypeScannerLookup typeScanner, IServiceLocator serviceLocator)
Parameters
Type | Name | Description |
---|---|---|
ITypeScannerLookup | typeScanner | The type scanner. |
IServiceLocator | serviceLocator | The service locator. |
Remove(String)
Removes the DisplayOption with the specified id
Declaration
public virtual void Remove(string id)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | The id if the display option to remove. |
Explicit Interface Implementations
IInitializableModule.Initialize(InitializationEngine)
Declaration
[Obsolete("No longer used as IInitializableModule")]
void IInitializableModule.Initialize(InitializationEngine context)
Parameters
Type | Name | Description |
---|---|---|
InitializationEngine | context |
IInitializableModule.Uninitialize(InitializationEngine)
Declaration
[Obsolete("No longer used as IInitializableModule")]
void IInitializableModule.Uninitialize(InitializationEngine context)
Parameters
Type | Name | Description |
---|---|---|
InitializationEngine | context |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |