Пример #1
0
        /// <summary>
        /// 将当前选择扩展到整行:
        ///  * 如果没有选区,则选择当前行
        ///  * 如果选择没有跨行,则选择当前行
        ///  * 选择包含选择区域的整行
        /// </summary>
        /// <returns></returns>
        public static bool ExtendSelection(this DTE2 dte)
        {
            var view = dte.ActiveTextView();

            if (view == null)
            {
                return(false);
            }

            var selection = dte.Selection();

            ExtendToFullLine(selection);

            return(true);
        }