protected override object CreateControlCore() { var richEditContainer = new RichEditContainer(); if (!((IModelMemberViewItemRichEdit)Model).RichEdit.ShowToolBars) { richEditContainer.HideToolBars(); } richEditContainer.RichEditControl.ActiveViewType = RichEditViewType.Draft; richEditContainer.RichEditControl.Options.AutoCorrect.DetectUrls = false; richEditContainer.RichEditControl.Options.AutoCorrect.ReplaceTextAsYouType = false; richEditContainer.RichEditControl.Options.DocumentCapabilities.Bookmarks = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.CharacterStyle = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.HeadersFooters = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.Hyperlinks = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.InlinePictures = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.Numbering.Bulleted = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.Numbering.MultiLevel = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.Numbering.Simple = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.ParagraphFormatting = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.Paragraphs = DocumentCapability.Enabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.ParagraphStyle = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.Sections = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.Tables = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.DocumentCapabilities.TableStyle = DocumentCapability.Disabled; richEditContainer.RichEditControl.Options.HorizontalRuler.Visibility = RichEditRulerVisibility.Hidden; richEditContainer.RichEditControl.Views.DraftView.AllowDisplayLineNumbers = true; richEditContainer.RichEditControl.Views.DraftView.Padding = new Padding(70, 4, 0, 0); richEditContainer.RichEditControl.InitializeDocument += richEditControl_InitializeDocument; richEditContainer.RichEditControl.TextChanged += Editor_RtfTextChanged; richEditContainer.RichEditControl.AddService(typeof(ISyntaxHighlightService), new SyntaxHighlightService(this)); return(richEditContainer); }
protected override object CreateControlCore() { _richEditContainer = new RichEditContainer(); ControlBindingProperty = "RtfText"; return _richEditContainer; }