Class GenerateCSharpCsFieldExtensions
Extension methods that support the generation of source in the C# language from the CsField model.
Inherited Members
Namespace: CodeFactory.WinVs.Models.CSharp
Assembly: CodeFactory.WinVs.dll
Syntax
public static class GenerateCSharpCsFieldExtensions
Methods
GenerateCSharpFieldDeclaration(CsField, NamespaceManager, List<MapNamespace>, bool, CsSecurity, bool, string, string)
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 GenerateCSharpFieldDeclaration(this CsField source, NamespaceManager manager = null, List<MapNamespace> mappedNamespaces = null, bool includeKeywords = true, CsSecurity fieldSecurity = CsSecurity.Unknown, bool useCamelCase = false, string namePrefix = null, string nameSuffix = null)
Parameters
Type | Name | Description |
---|---|---|
CsField | source | The source CsField model to generate. |
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. |
bool | includeKeywords | Optional parameter that will include all keywords assigned to the field from the source model. This is true by default. |
CsSecurity | fieldSecurity | Optional parameter to set the target security for the field. |
bool | useCamelCase | Optional parameter that determines if the field name should set to camel case format, default is false. |
string | namePrefix | Optional prameter that determines if the field name will have a prefix assigned to it, default is null. |
string | nameSuffix | Optional parameter that determines if the field name will have a prefix assigned to it, default is null. |
Returns
Type | Description |
---|---|
string | Fully formatted field definition or null if the field data could not be generated. |
Examples
With Keywords [Security] [Keywords] [FieldType] [Name]; With Keywords and a constant [Security] [Keywords] [FieldType] [Name] = [Constant Value]; Without Keywords [Security] [FieldType] [Name]; Without Keywords and a constant [Security] [FieldType] [Name] = [Constant Value];