Class CommandArgumentExtensions
Extensions for command argument reflection.
Inheritance
System.Object
CommandArgumentExtensions
Namespace: TehGM.Wolfringo.Commands.Parsing
Assembly: Wolfringo.Commands.dll
Syntax
public static class CommandArgumentExtensions
Methods
| Improve this Doc View SourceGetArgumentName(ParameterInfo)
Gets name of the argument.
Declaration
public static string GetArgumentName(this ParameterInfo parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.ParameterInfo | parameter |
Returns
| Type | Description |
|---|---|
| System.String | Argument name. |
Remarks
If ArgumentNameAttribute is specified for the parameter, its value will be used. If it's missing, it will default to parameter name.
GetConvertingErrorAttribute(ParameterInfo)
Loads [ConvertingError] attribute specified for a param, or default if not present.
Declaration
public static ConvertingErrorAttribute GetConvertingErrorAttribute(this ParameterInfo parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.ParameterInfo | parameter |
Returns
| Type | Description |
|---|---|
| ConvertingErrorAttribute | Instance of attribute. |
GetMissingErrorAttribute(ParameterInfo)
Loads [MissingError] attribute specified for a param, or default if not present.
Declaration
public static MissingErrorAttribute GetMissingErrorAttribute(this ParameterInfo parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.ParameterInfo | parameter |
Returns
| Type | Description |
|---|---|
| MissingErrorAttribute | Instance of attribute. |
GetTypeName(ParameterInfo)
Gets name of the argument's type.
Declaration
public static string GetTypeName(this ParameterInfo parameter)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Reflection.ParameterInfo | parameter |
Returns
| Type | Description |
|---|---|
| System.String | Argument's type name. |
Remarks
If ArgumentTypeNameAttribute is specified for the parameter, its value will be used. If it's missing, it will default to parameter Type's name.