示例#1
0
        private void DeleteDocumentComments(object sender, EventArgs e)
        {
            var dte          = (DTE)this.ServiceProvider.GetService(typeof(DTE));
            var document     = dte.ActiveDocument;
            var textDocument = (TextDocument)document.Object("TextDocument");

            var startPoint = textDocument.StartPoint.CreateEditPoint();
            var endPoint   = textDocument.EndPoint.CreateEditPoint();

            var editText = CodeWorker.GetTextWithoutAutoComments(startPoint.GetText(endPoint));

            if (editText != String.Empty)
            {
                startPoint.ReplaceText(endPoint, editText, 1);
            }
        }