Exemplo n.º 1
0
 public ImageDecoratorEditorContextImpl(IProperties settings, ApplyDecoratorCallback applyDecoratorCallback, ImagePropertiesInfo imageProperties, IUndoUnitFactory undoHost, CommandManager commandManager)
 {
     _applyDecoratorCallback = applyDecoratorCallback;
     _settings        = settings;
     _imageProperties = imageProperties;
     _undoHost        = undoHost;
     _commandManager  = commandManager;
 }
 public ImageDecoratorEditorContextImpl(IProperties settings, ApplyDecoratorCallback applyDecoratorCallback, ImagePropertiesInfo imageProperties, IUndoUnitFactory undoHost, CommandManager commandManager)
 {
     _applyDecoratorCallback = applyDecoratorCallback;
     _settings = settings;
     _imageProperties = imageProperties;
     _undoHost = undoHost;
     _commandManager = commandManager;
 }
        /// <summary>
        /// Displays the editor (if one exists) for an image decorator in a dialog.
        /// </summary>
        /// <param name="imageDecorator"></param>
        /// <param name="ImageInfo"></param>
        /// <param name="applyCallback"></param>
        /// <param name="owner"></param>
        internal static DialogResult ShowImageDecoratorEditorDialog(ImageDecorator imageDecorator, ImagePropertiesInfo ImageInfo, ApplyDecoratorCallback applyCallback, IUndoUnitFactory undoUnitFactory, object state, IImageTargetEditor targetEditor, CommandManager commandManager)
        {
            ImageDecoratorEditor editor = imageDecorator.CreateEditor(commandManager);
            if (editor != null)
            {
                IProperties settings = ImageInfo.ImageDecorators.GetImageDecoratorSettings(imageDecorator);
                editor.LoadEditor(new ImageDecoratorEditorContextImpl(settings, new ApplyDecoratorCallback(applyCallback), ImageInfo, undoUnitFactory, commandManager), state, targetEditor);
                using (ImageDecoratorEditorForm editorForm = new ImageDecoratorEditorForm())
                {
                    editorForm.ImageDecoratorEditor = editor;

                    // for automation
                    editorForm.Name = imageDecorator.Id + "EditorForm";
                    return editorForm.ShowDialog();
                }
            }
            return DialogResult.Abort;
        }
Exemplo n.º 4
0
 public UndoableCommandHandler(EventHandler commandHandler, IUndoUnitFactory undoFactory)
 {
     _commandHandler = commandHandler;
     _undoFactory    = undoFactory;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Displays the editor (if one exists) for an image decorator in a dialog.
        /// </summary>
        /// <param name="imageDecorator"></param>
        /// <param name="ImageInfo"></param>
        /// <param name="applyCallback"></param>
        /// <param name="owner"></param>
        internal static DialogResult ShowImageDecoratorEditorDialog(ImageDecorator imageDecorator, ImagePropertiesInfo ImageInfo, ApplyDecoratorCallback applyCallback, IUndoUnitFactory undoUnitFactory, object state, IImageTargetEditor targetEditor, CommandManager commandManager)
        {
            ImageDecoratorEditor editor = imageDecorator.CreateEditor(commandManager);

            if (editor != null)
            {
                IProperties settings = ImageInfo.ImageDecorators.GetImageDecoratorSettings(imageDecorator);
                editor.LoadEditor(new ImageDecoratorEditorContextImpl(settings, new ApplyDecoratorCallback(applyCallback), ImageInfo, undoUnitFactory, commandManager), state, targetEditor);
                using (ImageDecoratorEditorForm editorForm = new ImageDecoratorEditorForm())
                {
                    editorForm.ImageDecoratorEditor = editor;

                    // for automation
                    editorForm.Name = imageDecorator.Id + "EditorForm";
                    return(editorForm.ShowDialog());
                }
            }
            return(DialogResult.Abort);
        }
 public UndoableCommandHandler(EventHandler commandHandler, IUndoUnitFactory undoFactory)
 {
     _commandHandler = commandHandler;
     _undoFactory = undoFactory;
 }