예제 #1
0
        public static void Main()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            Console.OutputEncoding = Encoding.Unicode;
            bool IsCalled = false;

            while (true)
            {
                TimerAndDelegate some = new TimerAndDelegate();
                //Console.WriteLine(some.Seconds);
                some = new TimerAndDelegate();

                SimpleDelegate something = new SimpleDelegate(TimerAndDelegate.Test);
                SimpleDelegate getJoke   = new SimpleDelegate(JokesDataBase.GetRandomJoke);
                if (some.Seconds == 30 && IsCalled == false)
                {
                    something.DynamicInvoke();
                    getJoke.DynamicInvoke();
                    Console.WriteLine();
                    IsCalled = true;
                }
                if (some.Seconds == 31)
                {
                    IsCalled = false;
                }
            }
        }