/// <summary>
        /// Creates an HTML block editor.
        /// </summary>
        /// <param name="htmlBlockId"></param>
        /// <param name="idSetter"></param>
        /// <param name="mod"></param>
        /// <param name="setup">The setup object for the HTML block editor.</param>
        public HtmlBlockEditor(int?htmlBlockId, Action <int> idSetter, out HtmlBlockEditorModification mod, HtmlBlockEditorSetup setup = null)
        {
            setup = setup ?? new HtmlBlockEditorSetup();

            this.mod = mod = new HtmlBlockEditorModification(htmlBlockId, htmlBlockId.HasValue ? HtmlBlockStatics.GetHtml(htmlBlockId.Value) : "", idSetter);

            var wysiwygEditor = new WysiwygHtmlEditor(
                mod.Html,
                true,
                (postBackValue, validator) => {
                this.mod.Html = postBackValue;
                setup.AdditionalValidationMethod?.Invoke(validator);
            },
                setup: setup.WysiwygSetup);

            component =
                new DisplayableElement(
                    context => {
                return(new DisplayableElementData(
                           setup.DisplaySetup,
                           () => new DisplayableElementLocalData("div"),
                           classes: new ElementClass(CssElementCreator.CssClass),
                           children: wysiwygEditor.PageComponent.ToCollection()));
            });

            validation = wysiwygEditor.Validation;
        }
 void ControlTreeDataLoader.LoadData()
 {
     CssClass = CssClass.ConcatenateWithSpace( CssElementCreator.CssClass );
     this.AddControlsReturnThis( wysiwygEditor = new WysiwygHtmlEditor( mod.Html, ckEditorConfiguration: ckEditorConfiguration ) );
 }
示例#3
0
 void ControlTreeDataLoader.LoadData()
 {
     CssClass = CssClass.ConcatenateWithSpace(CssElementCreator.CssClass);
     this.AddControlsReturnThis(wysiwygEditor = new WysiwygHtmlEditor(mod.Html, ckEditorConfiguration: ckEditorConfiguration));
 }