// this class is using system Action<>, it does not return anything
        // system Func<> returning something

        public void Process(string path, Action <Photo> photoFilterHandler)
        {
            Photo photo = Photo.Load(path);

            photoFilterHandler(photo);
            photo.Save();
        }
Exemplo n.º 2
0
        public void Process(PhotoFilterHandler filterHandler)
        {
            var photo = new Photo();

            filterHandler(photo);

            photo.Save();
        }
        //public delegate void PhotoFilterHandler(Photo photo); //Using the inbuilt Generic Delegate instead of creating one.
        public void Process(string path, Action <Photo> filterHandler)
        {
            var photo = new Photo(path);

            filterHandler(photo);
            //var filters = new PhotoFilters();
            //filters.ApplyBrightness(photo);
            //filters.ApplyContrast(photo);
            //filters.Resize(photo);
            photo.Save();
        }
Exemplo n.º 4
0
        public void Process()
        {
            var photo = new Photo();

            var filters = new PhotoFilters();

            filters.ApplyBrightness(photo);
            filters.ApplyContrast(photo);
            filters.Resize(photo);

            photo.Save();
        }