示例#1
0
 // Override this method to be notified when the text changes in the control
 protected virtual void OnTextChanged2(TextChanged2EventArgs args)
 {
     if (TextChanged2 != null)
     {
         TextChanged2(this, args);
     }
 }
示例#2
0
        private void NotifyTextChanged(ChangeDescription change, bool isUndo)
        {
            string _after = "";

            if (change.TextAfter != null)
            {
                _after = change.TextAfter;
            }

            string _before = "";

            if (change.TextBefore != null)
            {
                _before = change.TextBefore;
            }

            // No need to notify if there was no change, even though this method gets called
            // sometimes when text hasn't been altered.
            if (_after.Length == 0 && _before.Length == 0)
            {
                return;
            }

            TextChanged2EventArgs _args;

            if (isUndo)
            {
                _args = new TextChanged2EventArgs(change.Start, _after, _before);
            }
            else
            {
                _args = new TextChanged2EventArgs(change.Start, _before, _after);
            }

            OnTextChanged2(_args);
        }