示例#1
0
        public static void Main(string[] args)
        {
            // 準備
            Manager      manager = new Manager();
            UnderlinePen upen    = new UnderlinePen('~');
            MessageBox   mbox    = new MessageBox('*');
            MessageBox   sbox    = new MessageBox('/');

            manager.Register("strong message", upen);
            manager.Register("warning box", mbox);
            manager.Register("slash box", sbox);

            // 生成
            IProduct p1 = manager.Create("strong message");

            p1.Use("Hello, world.");
            IProduct p2 = manager.Create("warning box");

            p2.Use("Hello, world.");
            IProduct p3 = manager.Create("slash box");

            p3.Use("Hello, world.");

            Thread.Sleep(10000);
        }
        static void Main(string[] args)
        {
            var manager = new Manager();
            var upen    = new UnderlinePen('~');
            var mbox    = new MessageBox('*');
            var sbox    = new MessageBox('/');

            manager.Register("strong message", upen);
            manager.Register("warning box", mbox);
            manager.Register("slash box", sbox);

            var p1 = manager.Create("strong message");

            p1.Use("Yosano, Akiko.");

            var p2 = manager.Create("warning box");

            p2.Use("Yosano, Akiko.");

            var p3 = manager.Create("slash box");

            p3.Use("Yosano, Akiko.");
        }