Condividi tramite


Proprietà Windows2.Count

Ottiene un valore che indica il numero di oggetti in Windows2 raccolta.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

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

Valore proprietà

Tipo: System.Int32
Un Integer contenente il numero di oggetti in Windows2 raccolta.

Esempi

In questo esempio viene creato un oggetto Windows2 oggetto e visualizza il numero di windows nella raccolta.

Per ulteriori informazioni su come eseguire questo esempio viene illustrato come componente aggiuntivo, vedere Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione.

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);
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Windows2 Interfaccia

Overload Count

Spazio dei nomi EnvDTE80

Altre risorse

Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione