Пример #1
0
 public WorkInThread(Socket socket, int opCount, WorkItem item, string operation, Work work)
 {
     this.socket = socket;
     this.opCount = opCount;
     this.item = item;
     this.operation = operation;
     this.work = work;
 }
Пример #2
0
 public static void Print(WorkItem[] items)
 {
     System.Console.SetCursorPosition(0, 0);
     System.Console.ForegroundColor = ConsoleColor.White;
     System.Console.WriteLine("Work actual state");
     for (int i = 0; i < Work.MAXITEM; i++)
     {
         if (items[i].Status.Equals(WorkItemStatus.CREATED))
         {
             System.Console.ForegroundColor = ConsoleColor.Gray;
         }
         if (items[i].Status.Equals(WorkItemStatus.PROGRESS))
         {
             System.Console.ForegroundColor = ConsoleColor.Red;
         }
         if (items[i].Status.Equals(WorkItemStatus.DONE))
         {
             System.Console.ForegroundColor = ConsoleColor.Green;
         }
         System.Console.WriteLine(items[i]);
     }
 }