Globals.VariableNames Eigenschaft
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Ruft eine Liste aller aktuellen globalen Variablennamen ab.
public:
property System::Object ^ VariableNames { System::Object ^ get(); };
public:
property Platform::Object ^ VariableNames { Platform::Object ^ get(); };
[System.Runtime.InteropServices.DispId(6)]
public object VariableNames { [System.Runtime.InteropServices.DispId(6)] get; }
[<System.Runtime.InteropServices.DispId(6)>]
[<get: System.Runtime.InteropServices.DispId(6)>]
member this.VariableNames : obj
Public ReadOnly Property VariableNames As Object
Eigenschaftswert
Ein Objekt, das alle aktuellen globalen Variablennamen darstellt.
- Attribute
Beispiele
Sub GlobalsExample(ByVal dte As DTE)
Dim globals As Globals
globals = dte.Solution.Globals
If globals.VariableExists("GlobalsExample") Then
' The counter has already been set, so increment it.
Dim int32 As System.Int32
int32 = System.Int32.Parse(CStr(globals("GlobalsExample")))
int32 += 1
globals("GlobalsExample") = int32.ToString()
Else
' Counter has never been set, so create and initialize it.
globals("GlobalsExample") = 1.ToString()
globals.VariablePersists("GlobalsExample") = True
End If
MsgBox("This variable has been called: " & _
globals.VariableValue("GlobalsExample") & " times.")
End Sub
void GlobalsExample(_DTE applicationObject)
{
Globals globals;
globals = applicationObject.Solution.Globals;
if(globals.get_VariableExists("GlobalsExample"))
{
// The counter has already been set, so increment it.
System.Int32 int32;
int32 = System.Int32.Parse((string)
globals["GlobalsExample"]);
int32++;
globals["GlobalsExample"] = int32.ToString();
}
else
{
// Counter has never been set, so create and initialize it.
globals["GlobalsExample"] = 1.ToString();
globals.set_VariablePersists("GlobalsExample", true);
}
System.Windows.Forms.MessageBox.Show("This variable has been called:
" + globals.VariableValue["GlobalsExample"] + " times.");
}