예제 #1
0
        static void Main(string[] args)
        {
            IStream stream  = new StringStream("Faculty of. Mathematics and Information Science, Warsaw. University of Technology");
            IStream another = new StringStream(" is the best place to learn about Decorators.Period.");
            IStream p1      = new LowerDecorator(stream);
            IStream p2      = new UpperDecorator(another);


            IStream przyklad = new DeszyfratorDecorator(new SzyfratorDecorator(new BigSmallDecorator(new PointUpperDecorator(new MergeDecorator(p1, p2))), 7), 7);

            while (!przyklad.AtEnd())
            {
                Console.Write(przyklad.ReadNext());
            }

            Console.WriteLine();
        }
예제 #2
0
        static void Main(string[] args)
        {
            IStream stream  = new StringStream("Faculty of Mathematics and Information Science, Warsaw University of Technology");
            IStream another = new StringStream(" is the best place to learn about Decorators. Period.");

            //stream = new ToSmallDecorator(stream);
            //stream = new ToGreaterDecorator(stream);
            //stream = new SpaceDecorator(stream);
            //stream = new ConcatenateDecorator(stream, another);
            //stream = new ConcatenateAndFirstToSmallDecorator(stream, another);
            //stream = new DeleteVowelsDecorator(stream);
            //stream = new AfterDotGreaterDecorator(stream);
            //stream = new CipherDecorator(stream,3);
            //stream = new GreaterLowerDecorator(stream);
            //stream = new OnlyNFirstCharsDecorator(stream, 5);
            //stream = new SkipNDecorator(stream, 5);

            while (!stream.AtEnd())
            {
                Console.Write(stream.ReadNext());
            }
            Console.WriteLine();
        }