1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| * using System;
* using System.Collections.Generic;
* using System.Text;
* using System.Threading;
* using System.IO;
*
* namespace MaitreDede.Plugins
* {
* /// <summary>
* /// Sample plugin : write the current time on the Console each second
* /// Plugin d'exemple : affiche l'heure actuelle sur la Console chaque seconde
* /// </summary>
* [Plugin("Sample plugin", "1.0.0.0")]
* public sealed class ClsPluginSample:ClsThreadPluginBase
* {
* /// <summary>
* /// Main loop
* /// </summary>
* protected override void Run()
* {
* while(this.Running)
* {
* Console.WriteLine(DateTime.Now.ToLongTimeString());
* Thread.Sleep(1000);
* }
* }
*
* /// <summary>
* /// Save the plugin state (for restarting)
* /// </summary>
* /// <param name="saveStream">Stream where to save data</param>
* public override void SaveState(Stream saveStream)
* {
* //Nothing to save
* }
*
* /// <summary>
* /// Load the plugin state (for restarting)
* /// </summary>
* /// <param name="saveStream">Stream where to load data</param>
* public override void LoadState(Stream saveStream)
* {
* //Nothing to load
* }
* }
* } |
Partager