public void Execute(MyEventWaitHandler _eventHandle)
 {
     Thread[] threads = new Thread[10];
     for (int i = 0; i < threads.Length; i++)
     {
         threads[i] = new Thread(Method);
         threads[i].Start();
         string name = _eventHandle.WaitNew();
         if (name == "WindowsApplicationMode")
         {
             //Execute case for first process
         }
         else if (name == "WebApplicationMode")
         {
             //Execute case for second process
         }
     }
 }
 public void Main()
 {
     Thread[] threads = new Thread[10];
     for (int i = 0; i < threads.Length; i++)
     {
         threads[i] = new Thread(Method);
         threads[i].Start();
         string name = _eventHandle.WaitNew();
         if (name == "Mode1")
         {
             //Execute case for first process
         }
         else if (name == "Mode2")
         {
             //Execute case for second process
         }
     }
 }