Ejemplo n.º 1
0
        void TryApply()
        {
            if (NeedsSelection && !State.HasSelection)
            {
                throw new Exception("Cannot apply without selection!");
            }

            int done = 0;

            foreach (Photo photo in State.Items)
            {
                LoadPhoto(photo, out var input, out var input_profile);

                var edited = Process(input, input_profile);
                input.Dispose();

                bool createVersion = photo.DefaultVersion.IsProtected;
                photo.SaveVersion(edited, createVersion);
                photo.Changes.DataChanged = true;
                App.Instance.Database.Photos.Commit(photo);

                done++;

                ProcessingStep?.Invoke(done);
            }

            Reset();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Processing state constructor
 /// </summary>
 /// <param name="StartStep">
 /// First step of the request processing pipeline
 /// </param>
 public RequestProcessingState(ProcessingStep StartStep)
 {
     NextStep = StartStep;
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Processing state constructor
 /// </summary>
 /// <param name="StartStep">
 ///     First step of the request processing pipeline
 /// </param>
 public RequestProcessingState(ProcessingStep StartStep)
 {
     NextStep = StartStep;
 }