Partager via


Documents.Count, propriété

Obtient une valeur indiquant le nombre d'objets de la collection Documents.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

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

Valeur de propriété

Type : System.Int32
Valeur entière indiquant le nombre d'objets présents dans la collection Documents.

Exemples

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

Sécurité .NET Framework

Voir aussi

Référence

Documents Interface

EnvDTE, espace de noms

Autres ressources

Comment : compiler et exécuter les exemples de code du modèle objet Automation