Provides to create a new event class of a specific type.

Namespace:  LeCouteauSuisse.API
Assembly:  LeCouteauSuisseAPI (in LeCouteauSuisseAPI.dll) Version: 1.0.0.2 (1.0.0.2)

Syntax

C#
public GeneratorEvent GetNewGeneratorEvent(
	Type type
)
Visual Basic (Declaration)
Public Function GetNewGeneratorEvent ( _
	type As Type _
) As GeneratorEvent
Visual C++
public:
GeneratorEvent^ GetNewGeneratorEvent(
	Type^ type
)

Parameters

type
Type: System..::.Type
The type of the event class.

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);

See Also