Class CsTypeExtensions
Extension methods that support the CsType model.
Inherited Members
Namespace: CodeFactory.WinVs.Models.CSharp
Assembly: CodeFactory.WinVs.dll
Syntax
public static class CsTypeExtensions
Methods
IsTaskOnlyType(CsType)
Determines if the type is a task type.
Declaration
public static bool IsTaskOnlyType(this CsType source)
Parameters
Type | Name | Description |
---|---|---|
CsType | source | the source type to validate. |
Returns
Type | Description |
---|---|
bool | True if the type is a standard task or a generic task implementation. False otherwise. |
Exceptions
Type | Condition |
---|---|
CodeFactoryException | If no type definition is provided. |
IsTaskType(CsType)
Determines if the type is a task type.
Declaration
public static bool IsTaskType(this CsType source)
Parameters
Type | Name | Description |
---|---|---|
CsType | source | The source type to validate. |
Returns
Type | Description |
---|---|
bool | True if the type is a standard task or a generic task implementation. False otherwise. |
TaskReturnType(CsType)
Returns the type definition for the target type that is supported by a task type. If the type is not a task type it will return the type definition.
Declaration
public static CsType TaskReturnType(this CsType source)
Parameters
Type | Name | Description |
---|---|---|
CsType | source | source type to check. |
Returns
Type | Description |
---|---|
CsType | The target type or null if the type is void or a non generic task type. |
Exceptions
Type | Condition |
---|---|
CodeFactoryException | If no type definition is provided or the generic task type has no type definition. |
TypeInNamespace(CsType, string)
Checks to see if the type or any generic types in the type implement the target namespace.
Declaration
public static bool TypeInNamespace(this CsType source, string nameSpace)
Parameters
Type | Name | Description |
---|---|---|
CsType | source | Property to check |
string | nameSpace | target namespace to check for. |
Returns
Type | Description |
---|---|
bool | True if found in the type or generic parameters assigned to the type, false if not found. |
TypeInTargetNamespace(CsType, string)
Checks the type is stored in a target namespace.
Declaration
public static bool TypeInTargetNamespace(this CsType source, string targetNamespace)
Parameters
Type | Name | Description |
---|---|---|
CsType | source | Type to check |
string | targetNamespace | Target namespace to check in |
Returns
Type | Description |
---|---|
bool | True the type is in the target namespace, false if not. |
Exceptions
Type | Condition |
---|---|
CodeFactoryException | Could not access the target namespace data. |