Freigeben über


Documents.Count-Eigenschaft

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

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

Syntax

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

Eigenschaftswert

Typ: Int32
Ein ganzzahliger Wert, der die Anzahl der Objekte in der Documents-Auflistung angibt.

Beispiele

public void Example(DTE2 dte)
{
   try
   {
      // Run this code after opening up a project with at least one document.
      Documents docs;

      // Return the documents collection in the current application instance.
      docs = dte.Documents;

      // Show the number of open documents in the current application.
      MessageBox.Show(docs.Count.ToString());

      // Show the parent object of the current docs collection.
      MessageBox.Show(docs.Parent.FullName);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Documents Schnittstelle

EnvDTE-Namespace

Weitere Ressourcen

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