protected void ProcessSelectedConfigurationIndexChanged()
    {
        // The new image has been edited
        this._ImageUploaded = false;
        this._ImageEdited = true;

        // Update the preview
        this._UpdatePreview = true;

        // Open the image edit popup
        this._AutoOpenImageEditPopup = true;

        if (this.SelectedConfigurationIndexChanged != null)
        {
            string pictureTrimmerTID = this.popupPictureTrimmer1.TemporaryFileId;
            /// EVENT: Configuration index changed
            SelectedConfigurationIndexChangedEventArgs args = new SelectedConfigurationIndexChangedEventArgs(this._OutputResolution, this.CropConstraint, this.PostProcessingFilter, this.PreviewFilter);
            this.OnSelectedConfigurationIndexChanged(args);
            if (this.HasImage)
            {
                if (this.popupPictureTrimmer1.TemporaryFileId != pictureTrimmerTID)
                {
                    // The image has been reloeaded outside the control, exit.
                    return;
                }
            }
            else
            {
                // The image has been unloaded, exit.
                return;
            } 

            bool reloadImage = false;
            if (args.OutputResolutionChanged)
            {
                this._OutputResolution = args.OutputResolution;
                reloadImage = true;
            }
            if (args.CropConstraintChanged)
            {
                this._CropConstraint = args.CropConstraint;
                reloadImage = true;
            }
            if (args.PostProcessingFilterChanged)
            {
                this._PostProcessingFilter = args.PostProcessingFilter;
                // No need to reload if only the post filter has changed
                // AND - the updatePreview is surely already TRUE
            }
            if (args.PreviewFilterChanged)
            {
                this._PreviewFilter = args.PreviewFilter;
                // No need to reload if only the preview filter has changed
                // AND - the updatePreview is surely already TRUE
            }
            if (args.ReloadImageSet)
            {
                // Forced to reload the source image
                reloadImage = true;
            }

            if (reloadImage)
            {
                // Reload the image
                if (!args.ReloadImageSet)
                {
                    // Standard reload, use the current source image size to save memory
                    this.popupPictureTrimmer1.SetLoadImageData_ImageSize(this.SourceImageSize);
                    this.popupPictureTrimmer1.SetLoadImageData_ImageResolution(this.SourceImageResolution);
                    this.popupPictureTrimmer1.SetLoadImageData_ImageFormatId(this.SourceImageFormatId);
                }
                this.popupPictureTrimmer1.LoadImageFromFileSystem(this.TemporarySourceImageFilePath, this._OutputResolution, this.CropConstraint);
            }
        }
    }
 protected void OnSelectedConfigurationIndexChanged(SelectedConfigurationIndexChangedEventArgs e)
 {
     if (this.SelectedConfigurationIndexChanged != null)
     {
         this.SelectedConfigurationIndexChanged(this, e);
     }
 }