Proprietà Breakpoint2.FilterBy
Ottiene o imposta una condizione in cui viene impostato un punto di interruzione.
Spazio dei nomi: EnvDTE80
Assembly: EnvDTE80 (in EnvDTE80.dll)
Sintassi
'Dichiarazione
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)
Valore proprietà
Tipo: String
Stringa contenente una condizione in cui viene impostato un punto di interruzione.
Note
È possibile specificare una o più condizioni in cui è impostato un punto di interruzione. Utilizzare &(AND), ||(OR), !(NOT) e le parentesi per combinare le seguenti clausole:
MachineName == "computer"
ProcessID == 123
ProcessName = "processo"
ThreadID = 123
ThreadName = "thread"
Se non vengono specificate condizioni, il punto di interruzione viene impostato in tutti i processi e thread in qualsiasi computer.
Esempi
Nell'esempio seguente viene illustrato l'utilizzare della proprietà FilterBy.
Per verificare la proprietà:
Aprire il progetto di destinazione ed eseguire il componente aggiuntivo.
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");
}
Sicurezza di .NET Framework
- Attendibilità totale per il chiamante immediato. Impossibile utilizzare questo membro in codice parzialmente attendibile. Per altre informazioni, vedere Utilizzo di librerie da codice parzialmente attendibile.
Vedere anche
Riferimenti
Altre risorse
Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione