Class TypeExtensions
Extension methods for Type.
Inherited Members
Namespace: Microsoft.XboxStudios.BotBrain
Assembly: BotBrain.Core.dll
Syntax
public static class TypeExtensions
Methods
View SourceGetNameWithoutGenerics(Type)
Gets the type's name without any generic type suffix indicated by a backtick.
Declaration
public static string GetNameWithoutGenerics(this Type self)
Parameters
Type | Name | Description |
---|---|---|
Type | self | The type being extended. |
Returns
Type | Description |
---|---|
string | A string. |
GetPropertyOrField(Type, string, BindingFlags)
Gets the property with the given name, or if it doesn't exist, the field.
Declaration
public static MemberInfo? GetPropertyOrField(this Type self, string parameterName, BindingFlags flags)
Parameters
Type | Name | Description |
---|---|---|
Type | self | The type being extended. |
string | parameterName | The property or field name. |
BindingFlags | flags | The member's binding flags. |
Returns
Type | Description |
---|---|
MemberInfo | The property or field, if found, or else null. |