Freigeben über


Windows2.Count-Eigenschaft

Ruft einen Wert ab, der die Anzahl der in der Windows2-Auflistung enthaltenen Objekte angibt.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Syntax

'Declaration
ReadOnly Property Count As Integer
    Get
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int
function get Count () : int

Eigenschaftswert

Typ: System.Int32
Ein ganzzahliger Wert mit der Anzahl von Objekten in der Windows2-Auflistung.

Implementiert

Windows.Count

Beispiele

In diesem Beispiel wird ein Windows2-Objekt erstellt, und die Anzahl der Fenster in der Auflistung wird angezeigt.

Weitere Informationen zum Ausführen dieses Beispiels als Add-In finden Sie unter Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell.

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
 ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    CountWindowsExample(_applicationObject)
End Sub
Sub CountWindowsExample(ByVal dte As DTE2)
    Dim wins As Windows2
    wins = CType(_applicationObject.Windows, EnvDTE80.Windows2)
    MsgBox("The number of windows in the Windows2 collection is: " _
 & wins.Count)
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application, 
ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    CountWindowsExample(_applicationObject);
}
public void CountWindowsExample(DTE2 dte)
{
    Windows2 wins;
    wins = (EnvDTE80.Windows2)_applicationObject.Windows;
    MessageBox.Show("The number of windows in the Windows2
 collection is: " + wins.Count);
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Windows2 Schnittstelle

Count-Überladung

EnvDTE80-Namespace

Weitere Ressourcen

Gewusst wie: Kompilieren und Ausführen der Codebeispiele für das Automatisierungsobjektmodell