Ejemplo n.º 1
0
 public void RemoveWorker(DotaBotWorker worker)
 {
     try
     {
         var PID = worker.PID;
         worker.Dispose();
         Workers.Remove(worker);
         OnWorkerRemoved(PID);
     }
     catch
     {
         //TODO: добавить обработку
     }
 }
Ejemplo n.º 2
0
 public void AddWorkerByPID(string PID)
 {
     try
     {
         var p = System.Diagnostics.Process.GetProcessById(Convert.ToInt32(PID));
     }
     catch
     {
         return;
     }
     if (!String.IsNullOrEmpty(PID) && Workers.Where(x => x.PID == PID).FirstOrDefault() == null)
     {
         var worker = new DotaBotWorker(PID);
         worker.PostMsg += (pid, msg) => { OnWorkerMsg(pid, msg); };
         Workers.Add(worker);
         OnWorkerAdded(PID);
     }
 }