private bool DoHandleKey(char c, bool whiteSpaceOrPunctuation) { MarkupPointer blockBoundary; string htmlText = GetHtmlText(out blockBoundary); if (blockBoundary == null) { return(false); } // only do autoreplace after whitespace or punctuation if (whiteSpaceOrPunctuation && AutoReplaceEnabled) { MaybeScheduleDelayedAutoreplace(htmlText, c); } // handle typographic characters after any character if (TypographicReplacementEnabled) { _typographicCharacterHandler = new TypographicCharacterHandler(_blogPostHtmlEditorControl.SelectedMarkupRange, _blogPostHtmlEditorControl.InsertHtml, _imageEditingContext, _blogPostHtmlEditorControl.PostBodyElement, c, htmlText, blockBoundary); } // only do glossary replacements after whitespace or punctuation if (whiteSpaceOrPunctuation && AutoLinkEnabled) { MatchUrl(htmlText, InsertSuggestedUrl); } _linkIgnoreWord = null; return(false); }
private void MaybeExecuteDelayedAutoReplaceOperation(char c) { // The TCH's gravity must be set to right/left initially, to capture // the content generated by MSHTML's keystroke handling. But now it // must be snapped right, so that the _delayedAutoReplaceAction // replacement contents stay to the left of the TCH's range. if (_typographicCharacterHandler != null) { _typographicCharacterHandler.SetGravityRight(); } if (_delayedAutoReplaceAction != null) { AutoReplaceAction temp = _delayedAutoReplaceAction; _delayedAutoReplaceAction = null; temp.Execute(c); } if (_typographicCharacterHandler != null) { TypographicCharacterHandler tHandler = _typographicCharacterHandler; _typographicCharacterHandler = null; if (tHandler.HandleTypographicReplace()) { _lastActionWasReplace++; } } }
private bool DoHandleKey(char c, bool whiteSpaceOrPunctuation) { MarkupPointer blockBoundary; string htmlText = GetHtmlText(out blockBoundary); if (blockBoundary == null) return false; // only do autoreplace after whitespace or punctuation if (whiteSpaceOrPunctuation && AutoReplaceEnabled) MaybeScheduleDelayedAutoreplace(htmlText, c); // handle typographic characters after any character if (TypographicReplacementEnabled) _typographicCharacterHandler = new TypographicCharacterHandler(_blogPostHtmlEditorControl.SelectedMarkupRange, _blogPostHtmlEditorControl.InsertHtml, _imageEditingContext, _blogPostHtmlEditorControl.PostBodyElement, c, htmlText, blockBoundary); // only do glossary replacements after whitespace or punctuation if (whiteSpaceOrPunctuation && AutoLinkEnabled) MatchUrl(htmlText, InsertSuggestedUrl); _linkIgnoreWord = null; return false; }