示例#1
0
        static void Main(string[] args)
        {
            Display      d1 = new Display(new NormalDisplayImpl("Hello,Japan."));
            Display      d2 = new CountDisplay(new StarDisplayImpl("Hello,World."));
            CountDisplay d3 = new CountDisplay(new NormalDisplayImpl("Hello,Universe."));
            CountDisplay d4 = new CountDisplay(new StarDisplayImpl("Hello,Universe."));

            d1.ExecuteDisplay();
            d2.ExecuteDisplay();

            d3.MultiDisplay(5);
            d4.MultiDisplay(3);

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Display      d1 = new Display(new StringDisplayImpl("Hello, Japan."));
            Display      d2 = new CountDisplay(new StringDisplayImpl("Hello, World"));
            CountDisplay d3 = new CountDisplay(new StringDisplayImpl("Hello, Universe."));

            d1.DoDisplay();
            d2.DoDisplay();
            d3.DoDisplay();
            d3.MultiDisplay(5);

            Display d4 = new Display(new FileDisplayImpl("Sample.txt"));

            d4.DoDisplay();
        }
示例#3
0
        static void Main(string[] args)
        {
            Display      d1 = new Display(new StringDisplayImpl("Hello, Japan."));
            Display      d2 = new Display(new StringDisplayImpl("Hello, World."));
            CountDisplay d3 = new CountDisplay(new StringDisplayImpl("Hello, Universe."));

            d1.DisplayText();
            d2.DisplayText();
            d3.DisplayText();
            d3.MultiDisplay(5);

            RandomDisplay d4 = new RandomDisplay(new StringDisplayImpl("Hello, Galaxy."));

            d4.RandomDisplayText(10);

            CountDisplay d5 = new CountDisplay(new DisplayFile("Sample.txt"));

            d5.DisplayText();
            d5.MultiDisplay(3);
        }