public void ProcessToTest() { var Output = new LinkedList <string>(); var mainProcess = new MainProcess(); var f1 = new MyProcess1(); var f2 = new MyProcess2(); MyProcess.DrawedHandler OnDrawed = delegate(object sender, EventArgs e) { var de = ((DrawedEventArgs)e); Console.WriteLine(":" + Convert.ToString(de.n)); Output.AddLast(Convert.ToString(de.n)); }; f1.Drawed += new MyProcess.DrawedHandler(OnDrawed); f2.Drawed += new MyProcess.DrawedHandler(OnDrawed); while (mainProcess.State != State.Ended) { Output.AddLast("["); //Output.AddLast(String.Join(",", Process.allProcesses)); mainProcess.ExecuteTree(); mainProcess.DrawTree(null); //f1._ExecuteProcess(); //Console.WriteLine("RemoveOld[1/2]"); ProcessBase._RemoveOld(); //Console.WriteLine("RemoveOld[2/2]"); Output.AddLast("]"); } //Console.ReadKey(); }