获取或设置设定断点的条件。
命名空间:  EnvDTE80
程序集:  EnvDTE80(在 EnvDTE80.dll 中)
语法
声明
Property FilterBy As String
    Get
    Set
string FilterBy { get; set; }
property String^ FilterBy {
    String^ get ();
    void set (String^ value);
}
abstract FilterBy : string with get, set
function get FilterBy () : String
function set FilterBy (value : String)
属性值
类型:System.String
一个包含设置断点的条件的字符串。
备注
可以指定一个或多个设置断点的条件。 使用 &(AND)、||(OR)、!(NOT) 和括号组合下列子句:
MachineName == "machine"
ProcessID == 123
ProcessName = "process"
ThreadID = 123
ThreadName = "thread"
如果没有指定任何条件,则会在任意计算机上的所有进程和线程中设置断点。
示例
下面的示例演示如何使用 FilterBy 属性。
测试此属性:
打开目标项目并运行外接程序。
public static void FilterBy(EnvDTE80.DTE2 dte)
{
    // Setup debug Output window.
    Window w = (Window)dte.Windows.Item(EnvDTE.Constants.vsWindowKindOutput);
    w.Visible = true;
    OutputWindow ow = (OutputWindow)w.Object;
    OutputWindowPane owp = ow.OutputWindowPanes.Add("FilterBy Property Test");
    owp.Activate();
    //dte is a reference to the DTE2 object passed to you by the
    //OnConnection method that you implement when you create an Add-in.
    EnvDTE80.Debugger2 debugger = (EnvDTE80.Debugger2)dte.Debugger;
    debugger.Breakpoints.Add("", "Target001.cs", 15, 1, "",
        EnvDTE.dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, "C#", "", 0, "", 0,
        EnvDTE.dbgHitCountType.dbgHitCountTypeNone);
    EnvDTE80.Breakpoint2 b2 = (EnvDTE80.Breakpoint2)debugger.Breakpoints.Item(1);
    b2.FilterBy = "MachineName == " + "MyMachine" + " & " +
                  "ProcessID == " + "1000" + " & " +
                  "ProcessName == " + "NewProcess";
    string strFilterBy = b2.FilterBy.ToString();
    owp.OutputString(strFilterBy + "\n");
}
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。