private protected virtual string GetFocusedCommentText(IFocusCommentFocus commentFocus)
        {
            IFocusCommentCellView CellView = commentFocus.CellView;
            Document Documentation         = CellView.StateView.State.Node.Documentation;

            return(CommentHelper.Get(Documentation));
        }
        private protected virtual void SetTextFullSelection(IFocusTextFocus textFocus)
        {
            bool IsHandled = false;

            if (textFocus is IFocusStringContentFocus AsStringContentFocus)
            {
                string Text = GetFocusedStringContent(AsStringContentFocus);
                IFocusStringContentFocusableCellView CellView = AsStringContentFocus.CellView;
                SelectStringContent(CellView.StateView, CellView.PropertyName, 0, Text.Length);
                IsHandled = true;
            }
            else if (textFocus is IFocusCommentFocus AsCommentFocus)
            {
                string Text = GetFocusedCommentText(AsCommentFocus);
                IFocusCommentCellView CellView = AsCommentFocus.CellView;
                SelectComment(CellView.StateView, 0, Text.Length);
                IsHandled = true;
            }

            Debug.Assert(IsHandled);
        }
        private protected virtual void SetTextSelection(IFocusTextFocus textFocus)
        {
            bool IsHandled = false;

            int Start = CaretAnchorPosition >= 0 ? CaretAnchorPosition : 0;
            int End   = CaretPosition;

            if (textFocus is IFocusStringContentFocus AsStringContentFocus)
            {
                IFocusStringContentFocusableCellView CellView = AsStringContentFocus.CellView;
                SelectStringContent(CellView.StateView, CellView.PropertyName, Start, End);
                IsHandled = true;
            }
            else if (textFocus is IFocusCommentFocus AsCommentFocus)
            {
                IFocusCommentCellView CellView = AsCommentFocus.CellView;
                SelectComment(CellView.StateView, Start, End);
                IsHandled = true;
            }

            Debug.Assert(IsHandled);
        }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FocusCommentFocus"/> class.
 /// </summary>
 public FocusCommentFocus(IFocusCommentCellView cellView)
     : base(cellView)
 {
 }