Exemplo n.º 1
0
        /// <summary>
        /// The execute transaction inner.
        /// </summary>
        /// <param name="solution">
        /// The solution.
        /// </param>
        /// <param name="textControl">
        /// The text control.
        /// </param>
        public override void ExecuteTransactionInner(ISolution solution, ITextControl textControl)
        {
            ITreeNode element = Utils.GetElementAtCaret(solution, textControl);

            ITreeNode currentNode = element;

            currentNode.FindFormattingRangeToLeft().InsertNewLineAfter();
        }
        /// <summary>
        /// Indicates if the node is the first on its line.
        /// </summary>
        /// <param name="node">
        /// The node to check.
        /// </param>
        /// <returns>
        /// True if the node is the first on the line.
        /// </returns>
        public static bool IsFirstNodeOnLine(ITreeNode node)
        {
            ITreeNode leftNode = node.FindFormattingRangeToLeft();

            return leftNode == null || HasLineBreakBetween(leftNode, node);
        }