Class IParameterManagerExtensions
Contains extension methods for IParameterManager.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Core.dll
Syntax
public static class IParameterManagerExtensionsMethods
View SourceGet<T>(IParameterManager, IEnumerable<string>, JsonSerializer?)
Gets the first value from a list of parameter names.
Declaration
public static T Get<T>(this IParameterManager self, IEnumerable<string> parameterNames, JsonSerializer? jsonSerializer = null)Parameters
| Type | Name | Description | 
|---|---|---|
| IParameterManager | self | The parameter manager. | 
| IEnumerable<string> | parameterNames | The parameter names (case-insensitive). | 
| JsonSerializer | jsonSerializer | The json serializer. | 
Returns
| Type | Description | 
|---|---|
| T | The parameter value. | 
Type Parameters
| Name | Description | 
|---|---|
| T | The expected type of the parameter value, which must be a TimeSpan,  | 
Get<T>(IParameterManager, string, JsonSerializer?)
Gets the value of a parameter.
Declaration
public static T Get<T>(this IParameterManager self, string parameterName, JsonSerializer? jsonSerializer = null)Parameters
| Type | Name | Description | 
|---|---|---|
| IParameterManager | self | The parameter manager. | 
| string | parameterName | The parameter name (case-insensitive). | 
| JsonSerializer | jsonSerializer | The json serializer. | 
Returns
| Type | Description | 
|---|---|
| T | The parameter value. | 
Type Parameters
| Name | Description | 
|---|---|
| T | The expected type of the parameter value, which must be a TimeSpan,  | 
TryConvertTo<T>(object?, out T, JsonSerializer?)
Converts an object to the specified type.
Declaration
public static bool TryConvertTo<T>(object? value, out T result, JsonSerializer? jsonSerializer = null)Parameters
| Type | Name | Description | 
|---|---|---|
| object | value | The value to convert. | 
| T | result | The converted value. | 
| JsonSerializer | jsonSerializer | The json serializer. | 
Returns
| Type | Description | 
|---|---|
| bool | Whether or not the value was converted successfully. | 
Type Parameters
| Name | Description | 
|---|---|
| T | The type to convert to, which must be a TimeSpan,  | 
TryGetValue(IParameterManager, string, out object?)
Tries to get the value of a parameter.
Declaration
public static bool TryGetValue(this IParameterManager self, string parameterName, out object? value)Parameters
| Type | Name | Description | 
|---|---|---|
| IParameterManager | self | The parameter manager. | 
| string | parameterName | The parameter name (case-insensitive). | 
| object | value | The parameter value, if it was found. | 
Returns
| Type | Description | 
|---|---|
| bool | Whether the parameter value was found. | 
TryGet<T>(IParameterManager, IEnumerable<string>, out T, JsonSerializer?)
Tries to get a value with the given type from a list of parameter names.
Declaration
public static bool TryGet<T>(this IParameterManager self, IEnumerable<string> parameterNames, out T value, JsonSerializer? jsonSerializer = null)Parameters
| Type | Name | Description | 
|---|---|---|
| IParameterManager | self | The parameter manager. | 
| IEnumerable<string> | parameterNames | The parameter names (case-insensitive). | 
| T | value | The first parameter value found. | 
| JsonSerializer | jsonSerializer | The json serializer. | 
Returns
| Type | Description | 
|---|---|
| bool | Whether a parameter value was found. | 
Type Parameters
| Name | Description | 
|---|---|
| T | The expected type of the parameter value, which must be a TimeSpan,  | 
TryGet<T>(IParameterManager, string, out T, JsonSerializer?)
Tries to get the value of a parameter as a specific type.
Declaration
public static bool TryGet<T>(this IParameterManager self, string parameterName, out T value, JsonSerializer? jsonSerializer = null)Parameters
| Type | Name | Description | 
|---|---|---|
| IParameterManager | self | The parameter manager. | 
| string | parameterName | The parameter name (case-insensitive). | 
| T | value | The parameter value, if it was found. | 
| JsonSerializer | jsonSerializer | The json serializer. | 
Returns
| Type | Description | 
|---|---|
| bool | Whether a parameter value was found. | 
Type Parameters
| Name | Description | 
|---|---|
| T | The expected type of the parameter value, which must be a TimeSpan,  |