示例#1
0
文件: DIP_Good.cs 项目: rikrd92/Blog
        public static void Main()
        {
            // Send output to Printer
            IReader r = new KeyboardReader();
            IWriter pw = new PrinterWriter();
            Copy cp = new Copy(r, pw);
            cp.DoWork();

            // Send output to FileStream now 
            IWriter fw = new FileWriter();
            Copy cpf = new Copy(r, fw);
            cpf.DoWork();

            Console.ReadLine();
        }
示例#2
0
        public static void Main()
        {
            // Send output to Printer
            IReader r  = new KeyboardReader();
            IWriter pw = new PrinterWriter();
            Copy    cp = new Copy(r, pw);

            cp.DoWork();

            // Send output to FileStream now
            IWriter fw  = new FileWriter();
            Copy    cpf = new Copy(r, fw);

            cpf.DoWork();

            Console.ReadLine();
        }