Exemplo n.º 1
0
 public void Fix()
 {
     lock (FixLock)
     {
         // Do not allow for fix to run second time.
         if (Status == IssueStatus.Fixing)
         {
             return;
         }
     }
     SetStatus(IssueStatus.Fixing);
     Fixing?.Invoke(this, new EventArgs());
     LastException = null;
     try
     {
         FixTask();
     }
     catch (Exception ex)
     {
         LastException = ex;
         //throw;
     }
     finally
     {
         SetStatus(IssueStatus.Idle);
         Fixed?.Invoke(this, new EventArgs());
     }
 }
Exemplo n.º 2
0
 public void Fix(TimeSpan time)
 {
     _hpTimer.Stop();
     Thread.Sleep(time);
     IsBroken = false;
     Fixed?.Invoke(this);
 }
Exemplo n.º 3
0
 public void Fix()
 {
     Durability = Durability - FixPosibility > 0 ? Durability - FixPosibility : 0;
     Fixed?.Invoke(this, new FixedEventArgs()
     {
         Fixed = Durability
     });
 }
Exemplo n.º 4
0
 public void ConnectRods(TimeSpan time)
 {
     lock (lockObj)
     {
         Thread.Sleep(time);
         IsRodsDisconnect = false;
     }
     Fixed?.Invoke(this);
 }
Exemplo n.º 5
0
 public override void Fix(TimeSpan time)
 {
     lock (lockObj)
     {
         Thread.Sleep(time);
         IsBroken = false;
     }
     _liveTimer.Stop();
     Fixed?.Invoke(this);
 }
Exemplo n.º 6
0
        public virtual void Fix()
        {
            var oldDurability = Durability;

            Durability = (Durability >= FixPosibility) ? Durability - FixPosibility : 0;
            Fixed?.Invoke(this, new FixedEventArgs()
            {
                Fixed = Durability - oldDurability
            });
        }