Exemple #1
0
 /// <summary>
 /// Raises the ImageProcessingCommandFinished event.
 /// </summary>
 /// <param name="command">Executed command.</param>
 /// <param name="e">The <see cref="ImageProcessedEventArgs"/> instance containing the event data.</param>
 void OnImageProcessingCommandFinished(ProcessingCommandBase command, ImageProcessedEventArgs e)
 {
     if (ImageProcessingCommandFinished != null)
     {
         ImageProcessingCommandFinished(command, e);
     }
 }
Exemple #2
0
        /// <summary>
        /// Handler of the ProcessingCommandBase.Finished event.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="ImageProcessedEventArgs"/> instance containing the event data.</param>
        void command_Finished(object sender, ImageProcessedEventArgs e)
        {
            ProcessingCommandBase command = (ProcessingCommandBase)sender;

            command.Finished -= new EventHandler <ImageProcessedEventArgs>(command_Finished);

            if (command is ParallelizingProcessingCommand)
            {
                command = ((ParallelizingProcessingCommand)command).ProcessingCommand;
            }

            if (command is OverlayCommand ||
                command is OverlayWithBlendingCommand ||
                command is OverlayMaskedCommand)
            {
                if (_overlayImage != null)
                {
                    // dispose the temporary overlay image because the processing command is finished
                    _overlayImage.Dispose();
                    _overlayImage = null;
                }
                if (_maskImage != null)
                {
                    // dispose the temporary mask image because the processing command is finished
                    _maskImage.Dispose();
                    _maskImage = null;
                }
            }

            if (command is ImageComparisonCommand)
            {
                if (_comparisonImage != null)
                {
                    _comparisonImage.Dispose();
                    _comparisonImage = null;
                }
            }

            _isImageProcessingWorking = false;

            if (_imageProcessingUndoMonitor != null)
            {
                _imageProcessingUndoMonitor.Dispose();
                _imageProcessingUndoMonitor = null;
            }

            OnImageProcessingCommandFinished((ProcessingCommandBase)sender, e);
        }
Exemple #3
0
        /// <summary>
        /// Invokes the InputProcessed event.
        /// </summary>
        /// <param name="args">Arguments.</param>
        protected void OnInputProcessed(ImageProcessedEventArgs args)
        {
            if (args == null)
            {
                throw new ArgumentNullException("args");
            }
            EventHandler <ImageProcessedEventArgs> handler;

            lock (processedEventSync) {
                handler = imageProcessed;
            }
            if (handler != null)
            {
                handler(this, args);
            }
        }