Class DotNetMemberExtensions
Extension methods that support model that implement the IDotNetMember interface.
Inherited Members
Namespace: CodeFactory.DotNet
Assembly: CodeFactory.DotNet.dll
Syntax
public static class DotNetMemberExtensions
Methods
| Improve this Doc View SourceFormatCSharpComparisonHashCode(IDotNetEvent, bool, bool, bool)
Gets the hash code for a formatted event signature using the C# format.
Declaration
public static int FormatCSharpComparisonHashCode(this IDotNetEvent source, bool includeSecurity = false, bool includeAttributes = false, bool includeKeywords = false)
Parameters
Type | Name | Description |
---|---|---|
IDotNetEvent | source | The sources IDotNetEvent model. |
bool | includeSecurity | Optional parameter that determines to generate security in the definition. By default this is false. |
bool | includeAttributes | Optional parameter that determines if the attributes should be included in the definition. By default this is false. |
bool | includeKeywords | Optional parameter that determines if all keywords are included in the definition. By default this is false. |
Returns
Type | Description |
---|---|
int | The hash code of the formatted model. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This is thrown if the model is null. |
FormatCSharpComparisonHashCode(IDotNetField, bool, bool, bool)
Gets the hash code for a formatted field signature using the C# format.
Declaration
public static int FormatCSharpComparisonHashCode(this IDotNetField source, bool includeSecurity = false, bool includeAttributes = false, bool includeKeywords = false)
Parameters
Type | Name | Description |
---|---|---|
IDotNetField | source | The sources IDotNetField model. |
bool | includeSecurity | Optional parameter that determines to generate security in the definition. By default this is false. |
bool | includeAttributes | Optional parameter that determines if the attributes should be included in the definition. By default this is false. |
bool | includeKeywords | Optional parameter that determines if all keywords other then constant are included in the definition. By default this is false. |
Returns
Type | Description |
---|---|
int | The has code of the formatted field. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This is thrown if the model is null. |
FormatCSharpComparisonHashCode(IDotNetMethod, bool, bool, bool)
Gets the hash code for a formatted method signature using the C# format.
Declaration
public static int FormatCSharpComparisonHashCode(this IDotNetMethod source, bool includeSecurity = false, bool includeAttributes = false, bool includeKeywords = false)
Parameters
Type | Name | Description |
---|---|---|
IDotNetMethod | source | The sources IDotNetMethod model. |
bool | includeSecurity | Optional parameter that determines to generate security in the definition. By default this is false. |
bool | includeAttributes | Optional parameter that determines if the attributes should be included in the definition. By default this is false. |
bool | includeKeywords | Optional parameter that determines if all keywords are included in the definition. By default this is false. |
Returns
Type | Description |
---|---|
int | The hash code of the formatted model. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This is thrown if the model is null. |
FormatCSharpComparisonHashCode(IDotNetProperty, bool, bool, bool)
Gets the hash code for a formatted property signature using the C# format.
Declaration
public static int FormatCSharpComparisonHashCode(this IDotNetProperty source, bool includeSecurity = false, bool includeAttributes = false, bool includeKeywords = false)
Parameters
Type | Name | Description |
---|---|---|
IDotNetProperty | source | The sources IDotNetProperty model. |
bool | includeSecurity | Optional parameter that determines to generate security in the definition. By default this is false. |
bool | includeAttributes | Optional parameter that determines if the attributes should be included in the definition. By default this is false. |
bool | includeKeywords | Optional parameter that determines if all keywords are included in the definition. By default this is false. |
Returns
Type | Description |
---|---|
int | The hash code of the formatted model. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This is thrown if the model is null. |
FormatCSharpDeclarationSyntax(IDotNetEvent, bool, bool, bool, bool)
Generates the syntax definition of an event in c# syntax.
Declaration
public static string FormatCSharpDeclarationSyntax(this IDotNetEvent source, bool includeSecurity = true, bool includeAttributes = true, bool includeKeywords = true, bool includeAbstractKeyword = false)
Parameters
Type | Name | Description |
---|---|---|
IDotNetEvent | source | The source IDotNetEvent model to generate. |
bool | includeSecurity | Includes the security scope which was defined in the model. |
bool | includeAttributes | Includes definition of the attributes assigned to the model. |
bool | includeKeywords | Includes all keywords assigned to the source model. |
bool | includeAbstractKeyword | Will include the definition for the abstract keyword in the definition if it is defined. default is false. |
Returns
Type | Description |
---|---|
string | Fully formatted event definition or null if the event data could not be generated. |
FormatCSharpDeclarationSyntax(IDotNetField, bool, bool, bool)
Generates the syntax definition of field in c# syntax. The default definition with all options turned off will return the filed signature and constants if defined and the default values.
Declaration
public static string FormatCSharpDeclarationSyntax(this IDotNetField source, bool includeSecurity = true, bool includeAttributes = true, bool includeKeywords = true)
Parameters
Type | Name | Description |
---|---|---|
IDotNetField | source | The source IDotNetField model to generate. |
bool | includeSecurity | Includes the security scope which the field was defined in the model. |
bool | includeAttributes | Includes definition of the attributes assigned to the model. |
bool | includeKeywords | Includes all keywords assigned to the field from the source model. |
Returns
Type | Description |
---|---|
string | Fully formatted field definition or null if the field data could not be generated. |
FormatCSharpDeclarationSyntax(IDotNetMethod, bool, bool, bool, bool)
Generates the syntax definition of an method in c# syntax.
Declaration
public static string FormatCSharpDeclarationSyntax(this IDotNetMethod source, bool includeSecurity = true, bool includeAttributes = true, bool includeKeywords = true, bool includeAbstractKeyword = false)
Parameters
Type | Name | Description |
---|---|---|
IDotNetMethod | source | The source IDotNetMethod model to generate. |
bool | includeSecurity | Includes the security scope which was defined in the model. |
bool | includeAttributes | Includes definition of the attributes assigned to the model. |
bool | includeKeywords | Includes all keywords assigned to the source model. |
bool | includeAbstractKeyword | Will include the definition for the abstract keyword in the definition if it is defined. default is false. |
Returns
Type | Description |
---|---|
string | Fully formatted event definition or null if the event data could not be generated. |
FormatCSharpDeclarationSyntax(IDotNetProperty, bool, bool, bool, bool)
Generates the syntax definition of a default no backing fields property definition in c# syntax.
Declaration
public static string FormatCSharpDeclarationSyntax(this IDotNetProperty source, bool includeSecurity = true, bool includeAttributes = true, bool includeKeywords = true, bool includeAbstractKeyword = false)
Parameters
Type | Name | Description |
---|---|---|
IDotNetProperty | source | The source IDotNetProperty model to generate. |
bool | includeSecurity | Includes the security scope which the property was defined in the model. |
bool | includeAttributes | Includes definition of the attributes assigned to the model. |
bool | includeKeywords | Includes all keywords assigned to the property from the source model. |
bool | includeAbstractKeyword | Will include the definition for the abstract keyword in the definition if it is defined. default is false. |
Returns
Type | Description |
---|---|
string | Fully formatted property definition or null if the property data could not be generated. |
FormatCSharpMemberComparisonHashCode(IDotNetMember, MemberComparisonType)
Gets the hash code for a formatted model signature using the C# format.
Declaration
public static int FormatCSharpMemberComparisonHashCode(this IDotNetMember source, MemberComparisonType comparisonType = MemberComparisonType.Base)
Parameters
Type | Name | Description |
---|---|---|
IDotNetMember | source | The sources IDotNetModel model. |
MemberComparisonType | comparisonType | The type of comparision format to use when generating the hashcode. Default is set to the base comparision type. |
Returns
Type | Description |
---|---|
int | The has code of the formatted model. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | This is thrown if the model is null. |