Provides to create a new event class with a specific type, priority and some arguments.
Namespace:
LeCouteauSuisse.APIAssembly: LeCouteauSuisseAPI (in LeCouteauSuisseAPI.dll) Version: 1.0.0.2 (1.0.0.2)
Syntax
C# |
---|
public GeneratorEvent GetNewGeneratorEvent( Type type, Object[] args, EventPriority eventPriority ) |
Visual Basic (Declaration) |
---|
Public Function GetNewGeneratorEvent ( _ type As Type, _ args As Object(), _ eventPriority As EventPriority _ ) As GeneratorEvent |
Visual C++ |
---|
public: GeneratorEvent^ GetNewGeneratorEvent( Type^ type, array<Object^>^ args, EventPriority eventPriority ) |
Parameters
- type
- Type: System..::.Type
The type of the event class.
- args
- Type: array<
System..::.Object
>[]()[]
The array of arguments.
- eventPriority
- Type: LeCouteauSuisse.API..::.EventPriority
The priority of the event.
Return Value
Create and return an new event for the generator.
Remarks
When a generator will send a new event, it must use a GetNewGeneratorEvent() methods.
These methods create and initialize a new event class.
Examples
Here is an sample of creating a new event of the TimerGenerator :
CopyC#

// we pass some arguments in an object array when creating a TimerEvent class. Object[] args = new Object[2]; // first argument of a TimerEvent class args[0] = data; // second argument of a TimerEvent class args[1] = delay; // create the new TimerEvent class TimerEvent eventArgs = (TimerEvent)context.GetNewGeneratorEvent(typeof(TimerEvent), args);