private bool MaybeScheduleDelayedAutoreplace(string htmlText, char key) { if (_autoreplaceManager == null) return false; bool handled = false; int length; string replaceHtml = _autoreplaceManager.FindMatch(htmlText, out length); if (replaceHtml != null && length > 0 && htmlText != replaceHtml) { if (!ShouldAutoCorrect(htmlText, key, replaceHtml)) return false; MarkupRange insertMarkupRange = _blogPostHtmlEditorControl.SelectedMarkupRange.Clone(); for (int i = 0; i < length; i++) insertMarkupRange.Start.MoveUnit(_MOVEUNIT_ACTION.MOVEUNIT_PREVCHAR); insertMarkupRange.Start.Gravity = _POINTER_GRAVITY.POINTER_GRAVITY_Right; insertMarkupRange.End.Gravity = _POINTER_GRAVITY.POINTER_GRAVITY_Left; _delayedAutoReplaceAction = new AutoReplaceAction(_blogPostHtmlEditorControl, key, replaceHtml, insertMarkupRange); //_blogPostHtmlEditorControl.InsertHtml(insertMarkupRange.Start, insertMarkupRange.End, replaceHtml); handled = true; _lastActionWasReplace++; } return handled; }