Beispiel #1
0
 public void KillAlive()
 {
     if (!IsKeepingAlive)
     {
         return;
     }
     if (!(ManagerWorker is null))
     {
         ManagerWorker.Stop();
         ManagerWorker.Dispose();
         ManagerWorker = null;
     }
 }
Beispiel #2
0
 public void KeepAlive()
 {
     if (IsKeepingAlive)
     {
         return;
     }
     IsKeepingAlive = true;
     if (ManagerWorker is null)
     {
         ManagerWorker = new Trigger()
         {
             Enabled          = false,
             Name             = ManagerWorkerName,
             SingleLineWorker = true,
             Interval         = WorkerInterval,
             Index            = 0,
             Tag = this,
         };
     }
     ManagerWorker.Tick -= ManagerWorker_Tick;
     ManagerWorker.Tick += ManagerWorker_Tick;
     ManagerWorker.Start();
 }