void TextChanged(object sender, TextChangedEventArgs e) { if (_control.IsFocused) { var text = RichTextBoxUtility.GetText(_control); if (text.IndexOf(_lastText) != 0) { AddSentence(new TokenName(), ".EmulateClearText(", new TokenAsync(CommaType.Non), ");"); } AddSentence(new TokenName(), ".EmulateAppendText(", GenerateUtility.ToLiteral(text), new TokenAsync(CommaType.Before), ");"); } _lastText = RichTextBoxUtility.GetText(_control); }
static string GetText(RichTextBox rich) { return(RichTextBoxUtility.GetText(rich)); }
protected override void Attach() { _control = (RichTextBox)ControlObject; _control.TextChanged += TextChanged; _lastText = RichTextBoxUtility.GetText(_control); }