Exemple #1
0
        static void Main(string[] args)
        {
            Console.ReadKey();
            var controller = new ThreadController();

            controller.Processes.Add(new Animation1("animation_1"));
            controller.Processes.Add(new Animation2("animation_2"));
            controller.Processes.Add(new Animation3("animation_3"));
            controller.StartAll();
        }
Exemple #2
0
        static void TestResume1()
        {
            var pro1 = new TestProcess("pro1");

            pro1.SetAction(() =>
            {
                PutTime("process1", "Send Resume");
                pro1.TestResume("resume", "pro1", "pro2");
                PutTime("process1", "Resume");
            });
            controller.Processes.Add(pro1);
            var pro2 = new TestProcess("pro2");

            pro2.SetAction(() =>
            {
                Thread.Sleep(5000);
                PutTime("process2", "Wait");
                pro2.TestWait("resume");
                PutTime("process2", "Resume");
            });
            controller.Processes.Add(pro2);
            controller.StartAll();
            controller.Processes.Clear();
        }