peculiarities of generation of events and their parameters, illustrates

Event description

Flexberry Designer allows the user to describe the events and their arguments, for possible subsequent generation of source code in a CLR-compatible language (in particular, C#).

The events described inside the UML classes in the section methods, as follows:

/[AccessModifier)Name([ParamName:TypeEventArgs)

An example of the description of the event arguments and the event itself:

Example

Generating class event arguments

Class that are inherited from System.EventArgs. Also generates the delegate definition.

   // *** Start programmer edit section *** (Arguments CustomAttributes) 
    // *** End programmer edit section *** (Arguments CustomAttributes) 
    public class Аргументы : System.EventArgs
    {
        private string fарг1;
        // *** Start programmer edit section *** (Arguments CustomMembers) 
        // *** End programmer edit section *** (Arguments CustomMembers) 
        // *** Start programmer edit section *** (the Arguments.arg1 CustomAttributes) 
        // *** End programmer edit section *** (the Arguments.arg1 CustomAttributes) 
        public virtual string арг1
        {
            get
            {
                // *** Start programmer edit section *** (the Arguments.arg1 Get start) 
                // *** End programmer edit section *** (the Arguments.arg1 Get start) 
                string result = this.fарг1;
                // *** Start programmer edit section *** (the Arguments.Get arg1 end) 
                // *** End programmer edit section *** (the Arguments.Get arg1 end) 
                return result;
            }
            set
            {
                // *** Start programmer edit section *** (the Arguments.arg1 Set start) 
                // *** End programmer edit section *** (the Arguments.arg1 Set start) 
                this.fарг1 = value;
                // *** Start programmer edit section *** (the Arguments.Set arg1 end) 
                // *** End programmer edit section *** (the Arguments.Set arg1 end) 
            }
        }
    }
    public delegate void АргументыHandler(object sender, ICSSoft.Product.Аргументы e);

What is generated in the class where the event is defined

In the class source code is generated by the event declared a delegate type and the method swadesi this event.

 public event ICSSoft.Product.АргументыHandler Событие;

        // *** Start programmer edit section *** (Epsomite CustomAttributes) 
        // *** End programmer edit section *** (Epsomite CustomAttributes) 
        private void OnСобытие(ICSSoft.Product.Аргументы ea)
        {
            if ((this.Событие != null))
            {
                this.Событие(this, ea);
            }
        }

The basic properties of the event arguments

Example

Property Description Generation .Net language
Name Name UML class Name .Net class
Description a class description DocComment before the class definition
GenerateCatcher   If set, the generated class interceptor events to use event-oriented script interpreter (EBSI). If you do not plan EBSI, the checkmark must not be set.
Packet, NamespacePostfix Allow to set the Assembly and namespace in which to generate the type of see the Location of assemblies after code generation.
PBMembers Allows you to specify whether to brace the programmer within the class to “manual” introduction of the members of the class If the option is specified - generated bracket programmer for “manual” introduction of the members of the class.

Attribute properties of the event arguments

Example

Property Description Generation .Net language
AccessModifier Modifier generated .Net language properties Corresponding modifier properties (# - protected, - public, - private)
Name, Type   Virtual property with the same name and a private member of the class for this property. The type of the property and a private member - type attribute are converted from the source according to the map display types.
DefaultValue a default Private member registers an initializer with the specified default value. If you specify a value of an enumerated type, is generated to initialize the value of this type. If the type is not enumerable, then it is appropriate .Net-type and checks whether there is a public static property with the name of DefaultValue. Further, if a standard type (of namespace System), generated a simple initialization of a constant (e.g.: int idx=0). Otherwise generation halts with error
Description   DocComment before property definition
PBCustomAttributes Parenthesis programmer If the option is given, it is generated bracket programmer for manual application .Net attributes before the code properties.
PBGetEnd Parenthesis programmer If the option is given, it is generated bracket programmer for manual entering of code before the end of the accessor get.
PBGetStart Parenthesis programmer If the option is given, it is generated bracket programmer for manual entering the code after accessors get.
PBSetEnd Parenthesis programmer If the option is given, it is generated bracket programmer for manual entering of code before the end of the accessor set.
PBSetStart Parenthesis programmer If the option is given, it is generated bracket programmer for manual entering the code after the set accessor.

Properties methods event arguments

Properties and generation methods, see article class Methods and method parameters.

Example

Property Description Generation .Net language
AccessModifier Modifier event modifier Corresponding to the event definition (# - protected, - public, - private)
Name event Name event Name
Description Description DocComment before the method definition, Epsomite
Type   Not applicable
IsEvent Indicates that this is an event, not the method, duplicates the “/” in the definition of the event. Event is generated, not the method.
PBCustomAttributes   If the option is on, - is generated by the programmer bracket prior to the method definition Epsomite