The event to signal the service is stopping.
Namespace:
LeCouteauSuisse.APIAssembly: LeCouteauSuisseAPI (in LeCouteauSuisseAPI.dll) Version: 1.0.0.2 (1.0.0.2)
Syntax
C# |
---|
protected ManualResetEvent stopFlag |
Visual Basic (Declaration) |
---|
Protected stopFlag As ManualResetEvent |
Visual C++ |
---|
protected: ManualResetEvent^ stopFlag |
Remarks
In the Run()()() method you can use it to stop lauching event and release ressources to stop gracefully.
Examples
See this sample to add inside Run()()() method to check the stop flag :
CopyC#

while (!MustStop) // exit the loop on stopping { try { if (WaitStop(delay)) // wait, but exit the loop on stopping break; } catch (Exception ex) { context.Logger.Write(LoggerLevel.Error, "Generator " + context.Name + " error while waiting", ex); } // Put here your business code to send an event // eventArgs = (GeneratorEvent)context.GetNewGeneratorEvent(typeof(GeneratorEvent)); // base.OnNewEvent(eventArgs); }