Поделиться через


Documents.Count - свойство

Получает значение, указывающее число объектов в коллекции Documents.

Пространство имен:  EnvDTE
Сборка:  EnvDTE (в EnvDTE.dll)

Синтаксис

'Декларация
ReadOnly Property Count As Integer
int Count { get; }
property int Count {
    int get ();
}
abstract Count : int
function get Count () : int

Значение свойства

Тип: System.Int32
Целое число, представляющее число объектов в коллекции Documents.

Примеры

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

См. также

Ссылки

Documents Интерфейс

EnvDTE - пространство имен

Другие ресурсы

Практическое руководство. Компиляция и выполнение примеров кода модели объектов автоматизации