示例#1
0
 public MainWindow()
 {
     InitializeComponent();
     printer = new PrinterController();
     thread = new ThreadController();
     core = new AsciiController();
 }
示例#2
0
 private void ExecuteTask(IThreadController tc)
 {
     for (int i = 1; i <= 100 && !tc.IsStopRequested; i++)
     {
         Thread.Sleep(100);
         tc.SetProgress(i, 100);
     }
 }
示例#3
0
文件: Program.cs 项目: khlopkov/SPO
        private static long RunThread(IThreadController <int> controller, int[] arr, int key)
        {
            int[] arr1 = new int[arr.Length];
            Array.Copy(arr, arr1, arr1.Length);
            int[] arr2 = new int[arr.Length];
            Array.Copy(arr, arr2, arr1.Length);
            Thread    threadMerge = new Thread(new ParameterizedThreadStart(controller.RunSortMerge));
            Thread    threadShell = new Thread(new ParameterizedThreadStart(controller.RunSortShell));
            Thread    threadFind  = new Thread(new ParameterizedThreadStart(controller.RunFind));
            Stopwatch time        = Stopwatch.StartNew();

            threadMerge.Start(arr1);
            threadFind.Start(key);
            threadShell.Start(arr2);
            threadFind.Join();
            threadShell.Join();
            threadMerge.Join();
            time.Stop();
            return(time.ElapsedMilliseconds);
        }
示例#4
0
文件: Sorter.cs 项目: khlopkov/SPO
 public Sorter(IThreadController <T> controller)
 {
     this.controller = controller;
 }