Esempio n. 1
0
        public static void Main()
        {
            Console.WriteLine("Please enter the target number");
            int target = Convert.ToInt32(Console.ReadLine());

            sumOfNumbersCallback callback = new sumOfNumbersCallback(PrintSum);

            Number numb = new Number(target, callback);
            Thread t1   = new Thread(new ThreadStart(numb.PrintSumOftNumbers));

            t1.Start();
        }
Esempio n. 2
0
 public Number(int target, sumOfNumbersCallback callBackMethod)
 {
     this._target         = target;
     this._callBackMethod = callBackMethod;
 }