static void Main()
    {
        // Here, MyCounter is used as a name for Counter.CountDown.
        MyCounter cd1 = new MyCounter(10);
        int       i;

        do
        {
            i = cd1.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        MyCounter cd2 = new MyCounter(20);

        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        cd2.Reset(4);
        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
    }
Exemple #2
0
    static void Main()
    {
        // Notice how CountDown is qualified by Counter.
        Counter.CountDown cd1 = new Counter.CountDown(10);
        int i;

        do
        {
            i = cd1.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        // Again, notice how CountDown is qualified by Counter.
        Counter.CountDown cd2 = new Counter.CountDown(20);
        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        cd2.Reset(4);
        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
    }
Exemple #3
0
    public static void Main()
    {
        // Здесь Count используется в качестве имени вместо Counter.CountDown.
        Count cd1 = new Count(10);
        int   i;

        do
        {
            i = cd1.count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        Count cd2 = new Count(20);

        do
        {
            i = cd2.count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        cd2.reset(4);
        do
        {
            i = cd2.count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
    }
    static void Main()
    {
        // Обратите внимание на то, как класс CountDown
        // определяется с помощью пространства имен Counter.
        Counter.CountDown cd1 = new Counter.CountDown(10);
        int i;

        do
        {
            i = cd1.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();

        // Еще раз обратите внимание на то, как класс CountDown
        // определяется с помощью пространства имен Counter.
        Counter.CountDown cd2 = new Counter.CountDown(20);

        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();

        cd2.Reset(4);
        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
    }
Exemple #5
0
    public static void Main()
    {
        Counter.CountDown cd1 = new Counter.CountDown(10);
        int i;

        do
        {
            i = cd1.count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();

        Counter.CountDown cd2 = new Counter.CountDown(20);
        do
        {
            i = cd2.count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();

        cd2.reset(4);
        do
        {
            i = cd2.count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
    }
    static void Main()
    {
        // Здесь и далее псевдоним MyCounter используется
        // вместо составного имени Counter.CountDown.
        MyCounter cd1 = new MyCounter(10);
        int       i;

        do
        {
            i = cd1.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();

        MyCounter cd2 = new MyCounter(20);

        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();

        cd2.Reset(4);
        do
        {
            i = cd2.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
    }
    static void Main()
    {
        // This is CountDown in the Counter namespace.
        Counter.CountDown cd1 = new Counter.CountDown(10);
        // This is CountDown in the Counter2 namespace.
        Counter2.CountDown cd2 = new Counter2.CountDown();
        int i;

        do
        {
            i = cd1.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        cd2.Count();
    }
    static void Main()
    {
        // Это класс CountDown из пространства имен Counter.
        Counter.CountDown  cd1 = new Counter.CountDown(10);
        Counter2.CountDown cd2 = new Counter2.CountDown();

        int i;

        do
        {
            i = cd1.Count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();

        cd2.Count();
    }
    public static void Main()
    {
        // Этот класс CountDown находится в
        // пространстве имен Counter.
        Counter.CountDown cd1 = new Counter.CountDown(10);
        // Этот класс CountDown находится в
        // пространстве имен Counter2.
        Counter2.CountDown cd2 = new Counter2.CountDown();
        int i;

        do
        {
            i = cd1.count();
            Console.Write(i + " ");
        } while (i > 0);
        Console.WriteLine();
        cd2.count();
    }
        static void Main()
        {
            Counter.CountDown  cd1 = new Counter.CountDown(10);
            Counter2.CountDown cd  = new Counter2.CountDown();

            MyCounter cd4 = new MyCounter();

            int i;

            do
            {
                i = cd1.Count();
                Console.Write(i + " ");
            } while (i > 0);
            Console.WriteLine();

            Counter.CountDown cd2 = new Counter.CountDown(20);
            do
            {
                i = cd2.Count();
                Console.Write(i + " ");
            } while (i > 0);
            Console.WriteLine();

            cd2.Reset(4);
            do
            {
                i = cd2.Count();
                Console.Write(i + " ");
            } while (i > 0);
            Console.WriteLine();

            cd.Count();

            Console.ReadKey();
        }