Exemple #1
0
        public void Process(string path, Action <Photo> filterHandler)
        {
            var photo = Photo.Load(path);

            filterHandler(photo);

            photo.Save();
        }
Exemple #2
0
        //public delegate void PhotoFilterHandler(Photo photo);

        // Use generic delegates



        public void Process(string path, Action <Photo> filterHandler)
        {
            //System.Action<>
            //System.Func<>

            var photo = Photo.Load(path);

            filterHandler(photo);
            photo.Save();
        }
Exemple #3
0
        //Pointer for a function
        //Object knows how to call a method
        // Use: - An eventing design pattern is used
        //	  - the caller dosen't need to access other properties or methods
        //        on the object implementing the method

        //public delegate void PhotoFilterHandler(Photo photo);

        //public void Process(string path)
        //public void Process(string path, PhotoFilterHandler filterHandler)
        public void Process(string path, Action <Photo> filterHandler)
        {
            var photo = Photo.Load(path);

            //var filters = new PhotoFilters();
            //filters.ApplyShadow(photo);
            //filters.ApplyContrast(photo);

            filterHandler(photo);

            photo.Save();
        }