Class GorgonOptionBag
Provides a functionality for setting and reading various options from a predefined option bag.
Inheritance
GorgonOptionBag
Implements
Inherited Members
Namespace: Gorgon.Configuration
Assembly: Gorgon.Core.dll
Syntax
public sealed class GorgonOptionBag : GorgonNamedObjectList<IGorgonOption>, IGorgonNamedObjectList<IGorgonOption>, IList<IGorgonOption>, ICollection<IGorgonOption>, IGorgonOptionBag, IGorgonNamedObjectReadOnlyList<IGorgonOption>, IReadOnlyList<IGorgonOption>, IReadOnlyCollection<IGorgonOption>, IEnumerable<IGorgonOption>, IEnumerable
Constructors
| Edit this page View SourceGorgonOptionBag(IEnumerable<IGorgonOption>)
Initializes a new instance of the GorgonOptionBag class.
Declaration
public GorgonOptionBag(IEnumerable<IGorgonOption> options)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IGorgonOption> | options | Values and types used to initialize the options. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
ArgumentException | Thrown when the |
Methods
| Edit this page View SourceGetOptionValue<T>(string)
Function to retrieve the value for an option.
Declaration
public T GetOptionValue<T>(string optionName)
Parameters
Type | Name | Description |
---|---|---|
string | optionName | The name of the option. |
Returns
Type | Description |
---|---|
T | The value stored with the option. |
Type Parameters
Name | Description |
---|---|
T | The type of data for the option. |
SetOptionValue<T>(string, T)
Function to assign a value for an option.
Declaration
public void SetOptionValue<T>(string optionName, T value)
Parameters
Type | Name | Description |
---|---|---|
string | optionName | The name of the option. |
T | value | The value to assign to the option. |
Type Parameters
Name | Description |
---|---|
T | The type of data for the option. |