Show / Hide Table of Contents

Class ParameterManager

A class implementing a parameter manager.

Inheritance
object
ParameterManager
Implements
IParameterManager
IEnumerable<KeyValuePair<string, object>>
IEnumerable
IEquatable<IParameterManager>
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Core.dll
Syntax
[DataContract]
public class ParameterManager : IParameterManager, IEnumerable<KeyValuePair<string, object>>, IEnumerable, IEquatable<IParameterManager?>
Remarks

Initializes a new instance of the ParameterManager class.

Constructors

View Source

ParameterManager(params IParameterManager?[]?)

A class implementing a parameter manager.

Declaration
public ParameterManager(params IParameterManager?[]? fallbacks)
Parameters
Type Name Description
IParameterManager[] fallbacks

The fallback parameter managers.

Remarks

Initializes a new instance of the ParameterManager class.

View Source

ParameterManager(IEnumerable<KeyValuePair<string, object>>, params IParameterManager?[]?)

Initializes a new instance of the ParameterManager class.

Declaration
public ParameterManager(IEnumerable<KeyValuePair<string, object>> initial, params IParameterManager?[]? fallbacks)
Parameters
Type Name Description
IEnumerable<KeyValuePair<string, object>> initial

The initial parameters.

IParameterManager[] fallbacks

the fallback parameter managers.

Properties

View Source

Fallbacks

Gets a list of fallback parameter managers.

Declaration
public IReadOnlyList<IParameterManager>? Fallbacks { get; }
Property Value
Type Description
IReadOnlyList<IParameterManager>
View Source

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 (case-insensitive).

Property Value
Type Description
object

The parameter value.

View Source

OwnParameters

Gets a dictionary of parameters defined in this manager.

Declaration
[DataMember]
public IDictionary<string, object> OwnParameters { get; }
Property Value
Type Description
IDictionary<string, object>

Methods

View Source

ContainsKey(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.

View Source

Deserialize(string)

Deserializes a parameter manager instance.

Declaration
public static ParameterManager Deserialize(string input)
Parameters
Type Name Description
string input

The serialized string.

Returns
Type Description
ParameterManager

A new parameter manager from the serialized input.

View Source

Equals(IParameterManager?)

Returns whether or not two parameter managers are equal.

Declaration
public bool Equals(IParameterManager? other)
Parameters
Type Name Description
IParameterManager other

The other parameter manager to compare to.

Returns
Type Description
bool

Whether or not two parameter managers are equal.

View Source

Equals(object?)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
object.Equals(object)
View Source

GetEnumerator()

Gets the enumerator for enumerating the parameter manager's parameters.

Declaration
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Returns
Type Description
IEnumerator<KeyValuePair<string, object>>

An enumerator for the parameter manager.

View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
View Source

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.

View Source

Serialize()

Serializes the parameter manager to a string.

Declaration
public string Serialize()
Returns
Type Description
string

The serialized string.

Implements

IParameterManager
IEnumerable<T>
IEnumerable
IEquatable<T>

Extension Methods

IParameterManagerExtensions.Get<T>(IParameterManager, IEnumerable<string>, JsonSerializer?)
IParameterManagerExtensions.Get<T>(IParameterManager, string, JsonSerializer?)
IParameterManagerExtensions.TryGetValue(IParameterManager, string, out object?)
IParameterManagerExtensions.TryGet<T>(IParameterManager, IEnumerable<string>, out T, JsonSerializer?)
IParameterManagerExtensions.TryGet<T>(IParameterManager, string, out T, JsonSerializer?)
IEnumerableExtensions.WithoutLast<T>(IEnumerable<T>)
  • View Source
In this article
Back to top Generated by DocFX