Esempio n. 1
0
 private static int CheckCount()
 {
     lock (syncRoot)
     {
         if (runningCounter > 5)
         {
             string message = "Preventing " + HiddenAccessN.GetRobotName() + "from thread creation. You may only create 5 threads at same time.";
             LoggerN.logError(message);
             LoggerN.WriteLineToRobotsConsole(message);
             throw new AccessViolationException(message);
         }
         runningCounter++;
         return(runningCounter);
     }
 }
Esempio n. 2
0
 public static void ForceStopThread()
 {
     try
     {
         LoggerN.logMessage(HiddenAccessN.GetRobotName() + " is not stopping.  Forcing a stop.");
         robotThread.Priority = ThreadPriority.Lowest;
         robotThread.Abort();
         robotThread.Interrupt();
     }
     catch (Exception ex)
     {
         LoggerN.logError(ex);
         throw;
     }
 }