/// <summary> /// Handler called every time a comment is changed in the controller. /// </summary> /// <param name="operation">Details of the operation performed.</param> private protected override void OnCommentChanged(WriteableChangeCommentOperation operation) { bool IsSameFocus = IsSameChangeCommentOperationFocus((FocusChangeCommentOperation)operation); int NewCaretPosition = ((IFocusChangeCaretOperation)operation).NewCaretPosition; bool ChangeCaretBeforeText = ((IFocusChangeCaretOperation)operation).ChangeCaretBeforeText; if (IsSameFocus && NewCaretPosition >= 0 && ChangeCaretBeforeText) { CaretPosition = NewCaretPosition; } base.OnCommentChanged(operation); if (IsSameFocus && NewCaretPosition >= 0 && !ChangeCaretBeforeText) { CaretPosition = NewCaretPosition; } IFocusNodeState State = ((FocusChangeCommentOperation)operation).State; Debug.Assert(State != null); Debug.Assert(StateViewTable.ContainsKey(State)); ResetSelection(); CheckCaretInvariant(); }
/// <summary> /// Handler called every time a comment is changed in the controller. /// </summary> /// <param name="operation">Details of the operation performed.</param> private protected override void OnCommentChanged(WriteableChangeCommentOperation operation) { base.OnCommentChanged(operation); ILayoutNodeState State = ((LayoutChangeCommentOperation)operation).State; Debug.Assert(State != null); Debug.Assert(StateViewTable.ContainsKey(State)); }