Class CsFieldExtensions
Extensions class that manage extensions that support CodeFactory models that implement the CsField model.
Inherited Members
Namespace: CodeFactory.Formatting.CSharp
Assembly: CodeFactory.Formatting.CSharp.dll
Syntax
public static class CsFieldExtensions
Methods
| Improve this Doc View SourceCSharpFormatFieldDeclaration(CsField, NamespaceManager, bool, CsSecurity)
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 CSharpFormatFieldDeclaration(this CsField source, NamespaceManager manager = null, bool includeKeywords = true, CsSecurity fieldSecurity = CsSecurity.Unknown)
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. |
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. |
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];