Class GenerateCSharpAttributeExtensions
Extension methods that support the generation of source in the C# language from the CsAttribute model.
Inherited Members
Namespace: CodeFactory.WinVs.Models.CSharp
Assembly: CodeFactory.WinVs.dll
Syntax
public static class GenerateCSharpAttributeExtensions
Methods
GenerateCSharpAttributeDeclarationEnumerator(IReadOnlyList<CsAttribute>, NamespaceManager, List<MapNamespace>)
An iterator that returns fully formatted declaration syntax for a attribute in the C# language
Declaration
public static IEnumerable<string> GenerateCSharpAttributeDeclarationEnumerator(this IReadOnlyList<CsAttribute> source, NamespaceManager manager = null, List<MapNamespace> mappedNamespaces = null)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<CsAttribute> | source | List of attributes to be processed. |
NamespaceManager | manager | Namespace manager used to format type names.This is an optional parameter. |
List<MapNamespace> | mappedNamespaces | Optional parameter that provides namespaces to be mapped to. |
Returns
Type | Description |
---|---|
IEnumerable<string> | Fully formatted syntax for the attribute. |
GenerateCSharpAttributeParameterValueSignature(CsAttributeParameterValue)
Creates the implementation of an attribute value formatted for C#.
Declaration
public static string GenerateCSharpAttributeParameterValueSignature(this CsAttributeParameterValue source)
Parameters
Type | Name | Description |
---|---|---|
CsAttributeParameterValue | source | The source value to format. |
Returns
Type | Description |
---|---|
string | The formatted value, or null if the model does not exist. |
GenerateCSharpAttributeParametersSignature(IReadOnlyList<CsAttributeParameter>)
Extension method that creates the attributes parameters list for a attribute definition in c# syntax format.
Declaration
public static string GenerateCSharpAttributeParametersSignature(this IReadOnlyList<CsAttributeParameter> source)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<CsAttributeParameter> | source | THe source list of parameters to be created. |
Returns
Type | Description |
---|---|
string | The fully formatted parameters section of a attribute declaration. |
GenerateCSharpAttributeSignature(CsAttribute, NamespaceManager, List<MapNamespace>)
Extension method that returns a full attribute declaration in the C# language format.
Declaration
public static string GenerateCSharpAttributeSignature(this CsAttribute source, NamespaceManager manager = null, List<MapNamespace> mappedNamespaces = null)
Parameters
Type | Name | Description |
---|---|---|
CsAttribute | source | The attribute toe generate the c# signature for. |
NamespaceManager | manager | Optional parameter that contains all the using statements from the source code, when used will replace namespaces on type definition in code. |
List<MapNamespace> | mappedNamespaces | Optional parameter that provides namespaces to be mapped to. |
Returns
Type | Description |
---|---|
string | The formatted attribute signature or null if data was missing to create the attribute. |