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


BuildDependencies.Item - метод

Возвращает индексированный член коллекции BuildDependencies.

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

Синтаксис

'Декларация
Function Item ( _
    index As Object _
) As BuildDependency
BuildDependency Item(
    Object index
)
BuildDependency^ Item(
    [InAttribute] Object^ index
)
abstract Item : 
        index:Object -> BuildDependency 
function Item(
    index : Object
) : BuildDependency

Параметры

  • index
    Тип: System.Object
    Обязательный.Индекс возвращаемого элемента.

Возвращаемое значение

Тип: EnvDTE.BuildDependency
Объект BuildDependency.

Заметки

Метод Item вызывает исключение ArgumentException, если в коллекции не удается найти объект, соответствующий значению индекса.

Примеры

public void Example(DTE2 dte)
{
   try
   {
      BuildDependencies bldDepends;
      BuildDependency bldDependency = null;

      // Get the BuildDependencies in open solution.
      bldDepends = dte.Solution.SolutionBuild.BuildDependencies;
      if (bldDepends.Count > 0) // assign the BuildDependency
         bldDependency = bldDepends.Item(bldDepends.Count);
      // Show the BuildDependency returned by the Item property.
      MessageBox.Show(bldDependency.Project.Name);
      // Show the BuildDependencies top-level object.
      MessageBox.Show(bldDepends.DTE.Name);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}

Безопасность платформы .NET Framework

См. также

Ссылки

BuildDependencies Интерфейс

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

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

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