Class GenerateCSharpCsEventExtensions
Extension methods that support the generation of source in the C# language from the CsEvent model.
Inherited Members
Namespace: CodeFactory.WinVs.Models.CSharp
Assembly: CodeFactory.WinVs.dll
Syntax
public static class GenerateCSharpCsEventExtensions
Methods
GenerateCSharpEventDeclaration(CsEvent, NamespaceManager, List<MapNamespace>, string, bool, CsSecurity, bool, bool, bool, bool, bool, bool, bool, string, string)
Generates the syntax definition of an event in c# syntax.
Declaration
public static string GenerateCSharpEventDeclaration(this CsEvent source, NamespaceManager manager = null, List<MapNamespace> mappedNamespaces = null, string eventName = null, bool includeSecurity = true, CsSecurity eventSecurity = CsSecurity.Unknown, bool includeKeywords = true, bool includeAbstractKeyword = false, bool abstractKeyword = false, bool sealedKeyword = false, bool staticKeyword = false, bool virtualKeyword = false, bool overrideKeyword = false, string namePrefix = null, string nameSuffix = null)
Parameters
Type | Name | Description |
---|---|---|
CsEvent | source | The source CsEvent 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. |
string | eventName | Optional parameter that will set the event name to the provided name, default is null. |
bool | includeSecurity | Includes the security scope which was defined in the model. |
CsSecurity | eventSecurity | Optional parameter that sets the target security scope for the event. |
bool | includeKeywords | Optional parameter that determines if it will include all keywords assigned to the source model, default is false. |
bool | includeAbstractKeyword | Optional parameter that determines if it will include the definition for the abstract keyword in the definition if it is defined. default is false. |
bool | abstractKeyword | Optional flag that determines if the abstract keyword is added to the event, default is false. |
bool | sealedKeyword | Optional flag that determines if the sealed keyword is added to the event, default is false. |
bool | staticKeyword | Optional flag that determines if the static keyword is added to the event, default is false. |
bool | virtualKeyword | Optional flag that determines if the virtual keyword is added to the event, default is false. |
bool | overrideKeyword | Optional flag that determines if the override keyword is added to the event, default is false. |
string | namePrefix | Optional parameter that determines if the name will have a prefix assigned to it, default is null. |
string | nameSuffix | Optional parameter that determines if the name will have a prefix assigned to it, default is null. |
Returns
Type | Description |
---|---|
string | Fully formatted event definition or null if the event data could not be generated. |
Examples
With Keywords [security] [keywords] event [event handler type] [name]; Without Keywords [security] [keywords] event [event handler type] [name];
GenerateCSharpInterfaceEventDeclaration(CsEvent, NamespaceManager, List<MapNamespace>, string, string)
Defines a standard event declaration for a interface.
Declaration
public static string GenerateCSharpInterfaceEventDeclaration(this CsEvent source, NamespaceManager manager = null, List<MapNamespace> mappedNamespaces = null, string namePrefix = null, string nameSuffix = null)
Parameters
Type | Name | Description |
---|---|---|
CsEvent | source | Event model to load. |
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. |
string | namePrefix | Optional prameter that determines if the name will have a prefix assigned to it, default is null. |
string | nameSuffix | Optional parameter that determines if the name will have a prefix assigned to it, default is null. |
Returns
Type | Description |
---|---|
string | Fully formatted event definition or null if the event data could not be generated. |