Class ReflectionParameterManager
A parameter manager implemented using reflection.
Implements
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Core.dll
Syntax
public class ReflectionParameterManager : IParameterManager, IEnumerable<KeyValuePair<string, object>>, IEnumerable, IEquatable<IParameterManager?>
Remarks
Initializes a new instance of the ReflectionParameterManager class.
Constructors
View SourceReflectionParameterManager(object)
A parameter manager implemented using reflection.
Declaration
public ReflectionParameterManager(object owner)
Parameters
Type | Name | Description |
---|---|---|
object | owner | The object to retrieve parameters from. |
Remarks
Initializes a new instance of the ReflectionParameterManager class.
Properties
View SourceFallbacks
Gets a list of fallback parameter managers.
Declaration
public IReadOnlyList<IParameterManager> Fallbacks { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<IParameterManager> |
this[string]
Retrieves a parameter value by name, checking the fallbacks if the parameter is not defined in this manager.
Declaration
public object? this[string parameterName] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
string | parameterName | The parameter name. |
Property Value
Type | Description |
---|---|
object | The parameter value. |
OwnParameters
Gets a dictionary of parameters defined in this manager.
Declaration
public IDictionary<string, object> OwnParameters { get; }
Property Value
Type | Description |
---|---|
IDictionary<string, object> |
Methods
View SourceContainsKey(string)
Gets whether or not the parameter is defined in this manager or in its fallbacks.
Declaration
public bool ContainsKey(string parameterName)
Parameters
Type | Name | Description |
---|---|---|
string | parameterName | The parameter name. |
Returns
Type | Description |
---|---|
bool | True if the parameter was found. |
Equals(IParameterManager?)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(IParameterManager? other)
Parameters
Type | Name | Description |
---|---|---|
IParameterManager | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<string, object>> | An enumerator that can be used to iterate through the collection. |
RemoveOwnKey(string)
Removes the given parameter from this manager, while leaving fallbacks unchanged.
Declaration
public void RemoveOwnKey(string parameterName)
Parameters
Type | Name | Description |
---|---|---|
string | parameterName | The parameter name. |