public SidebarUITheme(HtmlEditorSidebarHost sidebarControl) : base(sidebarControl, true)
 {
 }
 public SidebarUITheme(HtmlEditorSidebarHost sidebarControl) : base(sidebarControl, true)
 {
 }
Пример #3
0
        private void InitializeNormalEditor(IBlogPostEditingSite postEditingSite, IInternetSecurityManager internetSecurityManager, BlogPostHtmlEditorControl.TemplateStrategy templateStrategy, int dlControlFlags)
        {
            // configure editing options
            _mshtmlOptions = new MshtmlOptions();
            _mshtmlOptions.UseDivForCarriageReturn = GlobalEditorOptions.SupportsFeature(ContentEditorFeature.DivNewLine);
            // Commented out for now to prevent first chance exception
            //_mshtmlOptions.EditingOptions.Add(IDM.RESPECTVISIBILITY_INDESIGN, GlobalEditorOptions.SupportsFeature(ContentEditorFeature.HideNonVisibleElements));
            _mshtmlOptions.EditingOptions.Add(IDM.AUTOURLDETECT_MODE, false);
            _mshtmlOptions.EditingOptions.Add(IDM.MULTIPLESELECTION, false);
            _mshtmlOptions.EditingOptions.Add(IDM.LIVERESIZE, true);
            _mshtmlOptions.EditingOptions.Add(IDM.KEEPSELECTION, true);
            _mshtmlOptions.EditingOptions.Add(IDM.DISABLE_EDITFOCUS_UI, true);
            _mshtmlOptions.DLCTLOptions = dlControlFlags;
            _mshtmlOptions.DocHostUIOptionKeyPath = GlobalEditorOptions.GetSetting<string>(ContentEditorSetting.MshtmlOptionKeyPath);

            // create the editor
            _normalHtmlContentEditor = new BlogPostHtmlEditorControl(_mainFrameWindow, StatusBar, _mshtmlOptions, this, this, this, new SmartContentResizedListener(ResizedListener), new SharedCanvasImageReferenceFixer(ReferenceFixer), internetSecurityManager, CommandManager, templateStrategy, this);
            _normalHtmlContentEditor.PostBodyInlineStyle = GetPostBodyInlineStyleOverrides();
            // hookup services and events
            _normalHtmlContentEditor.HtmlGenerationService = new HtmlGenerator(this);
            _normalHtmlContentEditor.DataFormatHandlerFactory = new ExtendedHtmlEditorMashallingHandler(_normalHtmlContentEditor, this, this, postEditingSite as IDropTarget);
            _normalHtmlContentEditor.DocumentComplete += new EventHandler(htmlEditor_DocumentComplete);
            _normalHtmlContentEditor.GotFocus += htmlEditor_GotFocus;
            _normalHtmlContentEditor.LostFocus += htmlEditor_LostFocus;

            _normalHtmlContentEditor.SelectedImageResized += new SelectedImageResizedHandler(_normalHtmlContentEditor_SelectedImageResized);
            _normalHtmlContentEditor.UpdateImageLink += new UpdateImageLinkHandler(_normalHtmlContentEditor_UpdateImageLink);
            _normalHtmlContentEditor.HtmlInserted += new EventHandler(_normalHtmlContentEditor_HtmlInserted);
            _normalHtmlContentEditor.HelpRequest += new EventHandler(_normalHtmlContentEditor_HelpRequest);
            _normalHtmlContentEditor.EditorControl.AccessibleName = "Editor";

            _normalHtmlContentEditor.KeyboardLanguageChanged += new EventHandler(_normalHtmlContentEditor_KeyboardLanguageChanged);
            _normalHtmlContentEditor.TrackKeyboardLanguageChanges = true;

            // initialize the sidebar
            _htmlEditorSidebarHost = new HtmlEditorSidebarHost(_normalHtmlContentEditor);
            _htmlEditorSidebarHost.Dock = !BidiHelper.IsRightToLeft ? DockStyle.Right : DockStyle.Left;
            _htmlEditorSidebarHost.Width = Res.SidebarWidth;
            if (BidiHelper.IsRightToLeft)
            {
                _htmlEditorSidebarHost.RightToLeft = RightToLeft.Yes;
                BidiHelper.RtlLayoutFixup(_htmlEditorSidebarHost);
            }
            _editorContainer.Controls.Add(_htmlEditorSidebarHost);
            _htmlEditorSidebarHost.BringToFront();
            _htmlEditorSidebarHost.VisibleChanged += _htmlEditorSidebarHost_VisibleChanged;

            // register sidebars
            _htmlEditorSidebarHost.RegisterSidebar(new DisabledContentSourceSidebar(this));
            _htmlEditorSidebarHost.RegisterSidebar(new BrokenContentSourceSidebar(this));
            _htmlEditorSidebarHost.RegisterSidebar(new ContentSourceSidebar(this));
            _htmlEditorSidebarHost.RegisterSidebar(new ImagePropertiesSidebar(_normalHtmlContentEditor, this, new CreateFileCallback(CreateFileHandler)));
            _htmlEditorSidebarHost.AccessibleName = "Sidebar";

            // register the normal editor
            RegisterEditor(_normalHtmlContentEditor);
        }