public void Decorate(ImageDecoratorContext context) { if (context.InvocationSource == ImageDecoratorInvocationSource.Reset || context.InvocationSource == ImageDecoratorInvocationSource.InitialInsert) { //set the default HTML for this decorator. HtmlAlignDecoratorSettings settings = new HtmlAlignDecoratorSettings(context.Settings, context.ImgElement, context.InvocationSource); settings.Alignment = settings.DefaultAlignment; } //Note: all other times, this decorator is applied directly by the editor. }
protected override void LoadEditor() { base.LoadEditor(); HtmlAlignSettings = new HtmlAlignDecoratorSettings(EditorContext.Settings, EditorContext.ImgElement); Alignment = HtmlAlignSettings.Alignment; }
void IImageDecoratorDefaultSettingsCustomizer.CustomizeDefaultSettingsBeforeSave(ImageDecoratorEditorContext context, IProperties defaultSettings) { HtmlAlignDecoratorSettings settings = new HtmlAlignDecoratorSettings(defaultSettings, context.ImgElement); settings.DefaultAlignment = settings.Alignment; }