Class CsEventExtensions
Extensions class that manage extensions that support CodeFactory models that implement the CsEvent model.
Inherited Members
Namespace: CodeFactory.Formatting.CSharp
Assembly: CodeFactory.Formatting.CSharp.dll
Syntax
public static class CsEventExtensions
Methods
| Improve this Doc View SourceCSharpFormatEventDeclaration(CsEvent, NamespaceManager, bool, CsSecurity, bool, bool)
Generates the syntax definition of an event in c# syntax.
Declaration
public static string CSharpFormatEventDeclaration(this CsEvent source, NamespaceManager manager = null, bool includeSecurity = true, CsSecurity eventSecurity = CsSecurity.Unknown, bool includeKeywords = true, bool includeAbstractKeyword = false)
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. |
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. |
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];
| Improve this Doc View SourceCSharpFormatInterfaceEventDeclaration(CsEvent, NamespaceManager)
Defines a standard event declaration for a interface.
Declaration
public static string CSharpFormatInterfaceEventDeclaration(this CsEvent source, NamespaceManager manager = 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. |
Returns
Type | Description |
---|---|
string | Fully formatted event definition or null if the event data could not be generated. |