public ThreadToRule(int _sleep = 0, string _name = "default") { sleepTime = _sleep; myThread = new Thread(MainLogick); myThread.Name = _name; ObjectToSort job1 = new ObjectToSort(); job1.myThreadName = myThread.Name; job1.Done += job1.PrintJobDone; }
public void CreateNewThread(int _sleep = 0, string _name = "default") { sleepTime = _sleep; myThread = new Thread(StartThreadLogick); myThread.Name = _name; comparer = new ObjectToSort(); comparer.myThreadName = myThread.Name; work += comparer.StartSort; comparer.Done += comparer.PrintJobDone; comparer.OverSleep += comparer.PrintSleepOver; startSleep = Thread.Sleep; }