Example #1
0
        void IImageDecoratorDefaultSettingsCustomizer.CustomizeDefaultSettingsBeforeSave(ImageDecoratorEditorContext context, IProperties defaultSettings)
        {
            HtmlMarginDecoratorSettings settings = new HtmlMarginDecoratorSettings(defaultSettings, context.ImgElement);

            settings.UseUserCustomMargin = settings.HasCustomMargin;
            settings.UserDefaultMargin   = settings.Margin;
        }
        protected override void LoadEditor()
        {
            base.LoadEditor();
            HtmlMarginSettings = new HtmlMarginDecoratorSettings(Settings, EditorContext.ImgElement);

            comboBoxMargins.CustomMargins = HtmlMarginSettings.HasCustomMargin;
            MarginStyle marginStyle = HtmlMarginSettings.Margin;

            numericMarginTop.Value    = marginStyle.Top;
            numericMarginRight.Value  = marginStyle.Right;
            numericMarginBottom.Value = marginStyle.Bottom;
            numericMarginLeft.Value   = marginStyle.Left;

            marginCommand.Value = new Padding(marginStyle.Left, marginStyle.Top, marginStyle.Right, marginStyle.Bottom);
        }
 public void Decorate(ImageDecoratorContext context)
 {
     if (context.InvocationSource == ImageDecoratorInvocationSource.InitialInsert ||
         context.InvocationSource == ImageDecoratorInvocationSource.Reset)
     {
         HtmlMarginDecoratorSettings settings = new HtmlMarginDecoratorSettings(context.Settings, context.ImgElement);
         if (settings.UseUserCustomMargin)
         {
             settings.Margin = settings.UserDefaultMargin;
         }
         else
         {
             settings.Margin = HtmlMarginDecoratorSettings.WriterDefaultMargin;
         }
     }
 }
Example #4
0
 public void Decorate(ImageDecoratorContext context)
 {
     if (context.InvocationSource == ImageDecoratorInvocationSource.InitialInsert ||
         context.InvocationSource == ImageDecoratorInvocationSource.Reset)
     {
         HtmlMarginDecoratorSettings settings = new HtmlMarginDecoratorSettings(context.Settings, context.ImgElement);
         if (settings.UseUserCustomMargin)
         {
             settings.Margin = settings.UserDefaultMargin;
         }
         else
         {
             settings.Margin = HtmlMarginDecoratorSettings.WriterDefaultMargin;
         }
     }
 }
        protected override void LoadEditor()
        {
            base.LoadEditor();
            HtmlMarginSettings = new HtmlMarginDecoratorSettings(Settings, EditorContext.ImgElement);

            comboBoxMargins.CustomMargins = HtmlMarginSettings.HasCustomMargin;
            MarginStyle marginStyle = HtmlMarginSettings.Margin;

            numericMarginTop.Value = marginStyle.Top;
            numericMarginRight.Value = marginStyle.Right;
            numericMarginBottom.Value = marginStyle.Bottom;
            numericMarginLeft.Value = marginStyle.Left;

            marginCommand.Value = new Padding(marginStyle.Left, marginStyle.Top, marginStyle.Right, marginStyle.Bottom);

        }
 void IImageDecoratorDefaultSettingsCustomizer.CustomizeDefaultSettingsBeforeSave(ImageDecoratorEditorContext context, IProperties defaultSettings)
 {
     HtmlMarginDecoratorSettings settings = new HtmlMarginDecoratorSettings(defaultSettings, context.ImgElement);
     settings.UseUserCustomMargin = settings.HasCustomMargin;
     settings.UserDefaultMargin = settings.Margin;
 }