Breakpoint2.FilterBy Property
Gets or sets a condition at which a breakpoint is set.
Namespace: EnvDTE80
Assembly: EnvDTE80 (in EnvDTE80.dll)
Syntax
'Declaration
Property FilterBy As String
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)
Property Value
Type: String
A string containing a condition at which a breakpoint is set.
Remarks
You can specify one or more conditions at which a breakpoint is set. Use &(AND), ||(OR), !(NOT), and parentheses to combine the following clauses:
MachineName == "machine"
ProcessID == 123
ProcessName = "process"
ThreadID = 123
ThreadName = "thread"
If no conditions are specified, the breakpoint is set in all processes and threads on any machine.
Examples
The following example demonstrates how to use the FilterBy property.
To test this property:
Open the target project and run the add-in.
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 Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Other Resources
How to: Compile and Run the Automation Object Model Code Examples