且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Visual Studio中删除所有禁用的断点

更新时间:2023-02-27 14:18:28

对于我的

You can use the following command (language C#) for my Visual Commander extension to remove all disabled breakpoints:

using EnvDTE;
using EnvDTE80;
using System.Linq;

public class C : VisualCommanderExt.ICommand
{
    public void Run(EnvDTE80.DTE2 DTE, Microsoft.VisualStudio.Shell.Package package) 
    {
        DTE.Debugger.Breakpoints.Cast<Breakpoint>().Where(i => !i.Enabled).ToList().ForEach(i => i.Delete());
    }
}