public HtmlEditorControlDamageServices(HtmlEditorControl editorControl, MshtmlEditor mshtmlControl, DamageCommitStrategy commitStrategy)
        {
            _editorControl = editorControl;
            _mshtmlControl = mshtmlControl;
            wordRangeDamager = new WordRangeDamager(editorControl, mshtmlControl);

            _commitStrategy = commitStrategy;
            _commitStrategy.CommitDamage += new EventHandler(damageCommitStrategy_CommitDamage);
        }
        /// <summary>
        /// Link navigator used for navigating to links from within
        /// an editing session
        /// </summary>
        /// <param name="editorControl">presentation editor context</param>
        public EditorLinkNavigator(HtmlEditorControl editorControl, IMainFrameWindow editorFrame, IStatusBar statusBar, IMshtmlDocumentEvents events)
        {
            // save references
            _htmlEditorContext = editorControl as IHtmlEditorComponentContext;
            _htmlEditorControl = editorControl;
            _editorFrame = editorFrame;
            _statusBar = statusBar;
            _documentEvents = events;

            // sign up for editor events
            _editorFrame.Deactivate += new EventHandler(_editorFrame_Deactivate);
            _htmlEditorContext.PreHandleEvent += new HtmlEditDesignerEventHandler(presentationEditor_PreHandleEvent);
            _htmlEditorContext.TranslateAccelerator += new HtmlEditDesignerEventHandler(presentationEditor_TranslateAccelerator);
            _documentEvents.LostFocus += new EventHandler(_documentEvents_LostFocus);
        }
        public WordRangeDamager(HtmlEditorControl editorControl, MshtmlEditor mshtmlControl)
        {
            _editorControl = editorControl;
            _mshtmlEditor = mshtmlControl;

            damageQueue = new DamageRegionQueue();
            Reset();
        }
 public InvisibleUndoUnit(HtmlEditorControl editorControl)
     : base(editorControl, INVISIBLE_UNDO_UNIT_PREFIX + Guid.NewGuid().ToString())
 {
 }
 public InitialInsertionNotify(HtmlEditorControl editor)
 {
     Debug.Assert(editor != null, "Editor is unexpectedly null!");
     _editor = editor;
     _editor.FireBeforeInitialInsertion();
 }
            /// <summary>
            /// Create/initialize
            /// </summary>
            /// <param name="editor"></param>
            public UndoUnit(HtmlEditorControl editor)
                : this(editor, Guid.NewGuid().ToString())
            {

            }
            public UndoUnit(HtmlEditorControl editor, string title)
            {
                // save reference to editor
                _editor = editor;

                // begin undo unit
                _editor.MarkupServices.BeginUndoUnit(title);

                undoDepth++;
            }
            public SelectionUndoUnit(HtmlEditorControl editor, MarkupRange selection)
            {
                _editor = editor;
                _selection = selection;
                _markupServices = _editor.MshtmlEditor.MshtmlControl.MarkupServices;

                undoUnit = new SelectionOleUndoUnit(_markupServices, _selection);
                _editor.UndoManager.Add(undoUnit);
            }
        private void DisposeHtmlEditor(HtmlEditorControl htmlEditor)
        {
            htmlEditor.DocumentComplete -= new EventHandler(htmlEditor_DocumentComplete);
            htmlEditor.GotFocus -= new EventHandler(htmlEditor_GotFocus);
            htmlEditor.LostFocus -= new EventHandler(htmlEditor_LostFocus);
            htmlEditor.KeyboardLanguageChanged -= new EventHandler(_normalHtmlContentEditor_KeyboardLanguageChanged);
            htmlEditor.HelpRequest -= new EventHandler(_normalHtmlContentEditor_HelpRequest);

            htmlEditor.Dispose();
        }
 public void UpdateInlineImageSize(Size newSize, ImageDecoratorInvocationSource invocationSource, HtmlEditorControl currentEditor)
 {
     ImagePropertiesInfo.InlineImageSize = newSize;
     ApplyImageDecorations(ImagePropertyType.InlineSize, invocationSource);
 }
 public static void ApplyBlockStyle(HtmlEditorControl editor, _ELEMENT_TAG_ID styleTagId, MarkupRange selection, MarkupRange maximumBounds, MarkupRange postOpSelection)
 {
     new HtmlBlockFormatHelper(editor).ApplyBlockStyle(styleTagId, selection, maximumBounds, postOpSelection);
 }
 public HtmlBlockFormatHelper(HtmlEditorControl editor)
 {
     _editor = editor;
     _markupServices = (_editor as IHtmlEditorComponentContext).MarkupServices;
 }