Gorgon
Show / Hide Table of Contents

Class GorgonOptionBag

Provides a functionality for setting and reading various options from a predefined option bag.

Inheritance
object
GorgonBaseNamedObjectList<IGorgonOption>
GorgonNamedObjectList<IGorgonOption>
GorgonOptionBag
Implements
IGorgonNamedObjectList<IGorgonOption>
IList<IGorgonOption>
ICollection<IGorgonOption>
IGorgonOptionBag
IGorgonNamedObjectReadOnlyList<IGorgonOption>
IReadOnlyList<IGorgonOption>
IReadOnlyCollection<IGorgonOption>
IEnumerable<IGorgonOption>
IEnumerable
Inherited Members
GorgonNamedObjectList<IGorgonOption>.this[int]
GorgonNamedObjectList<IGorgonOption>.this[string]
GorgonNamedObjectList<IGorgonOption>.Clear()
GorgonNamedObjectList<IGorgonOption>.Add(IGorgonOption)
GorgonNamedObjectList<IGorgonOption>.AddRange(IEnumerable<IGorgonOption>)
GorgonNamedObjectList<IGorgonOption>.Insert(int, IGorgonOption)
GorgonNamedObjectList<IGorgonOption>.InsertRange(int, IEnumerable<IGorgonOption>)
GorgonNamedObjectList<IGorgonOption>.Remove(IGorgonOption)
GorgonNamedObjectList<IGorgonOption>.Remove(int)
GorgonNamedObjectList<IGorgonOption>.Remove(string)
GorgonBaseNamedObjectList<IGorgonOption>.KeysAreCaseSensitive
GorgonBaseNamedObjectList<IGorgonOption>.Contains(string)
GorgonBaseNamedObjectList<IGorgonOption>.IndexOf(string)
GorgonBaseNamedObjectList<IGorgonOption>.IndexOf(IGorgonOption)
GorgonBaseNamedObjectList<IGorgonOption>.Count
GorgonBaseNamedObjectList<IGorgonOption>.Contains(IGorgonOption)
GorgonBaseNamedObjectList<IGorgonOption>.CopyTo(IGorgonOption[], int)
GorgonBaseNamedObjectList<IGorgonOption>.GetEnumerator()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
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 Source

GorgonOptionBag(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 options parameter is null.

ArgumentException

Thrown when the options contains a value that is already in this option bag.

Methods

| Edit this page View Source

GetOptionValue<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.

| Edit this page View Source

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.

Implements

IGorgonNamedObjectList<T>
IList<T>
ICollection<T>
IGorgonOptionBag
IGorgonNamedObjectReadOnlyList<T>
IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonTreeLinqExtensions.TraverseDepthFirst<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonTreeLinqExtensions.Traverse<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonIReadOnlyListExtensions.Contains<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.CopyTo<T>(IReadOnlyList<T>, T[])
GorgonIReadOnlyListExtensions.FirstIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonIReadOnlyListExtensions.IndexOf<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.LastIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author