Beispiel #1
0
        private static void DecoratorExample()
        {
            const int maxImages = 1000;

            Console.WriteLine("Loading images...");
            IList<Bitmap> images = LoadImages(maxImages);

            IImageEditor serial = new SerialEditor();
            SampleUtilities.TimedAction(() => { serial.Rotate(RotateFlipType.RotateNoneFlipX, images); }, "Rotate, sequential");

            IImageEditor parallel = new ParallelEditor(new SerialEditor());
            SampleUtilities.TimedAction(() => { parallel.Rotate(RotateFlipType.RotateNoneFlipX, images); }, "Rotate, parallel");
        }
        private static void DecoratorExample()
        {
            const int maxImages = 1000;

            Console.WriteLine("Loading images...");
            IList <Bitmap> images = LoadImages(maxImages);

            IImageEditor serial = new SerialEditor();

            SampleUtilities.TimedAction(() => { serial.Rotate(RotateFlipType.RotateNoneFlipX, images); }, "Rotate, sequential");

            IImageEditor parallel = new ParallelEditor(new SerialEditor());

            SampleUtilities.TimedAction(() => { parallel.Rotate(RotateFlipType.RotateNoneFlipX, images); }, "Rotate, parallel");
        }