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


BuildDependencies.Parent - свойство

Получает ближайший родительский объект коллекции BuildDependencies.

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

Синтаксис

'Декларация
ReadOnly Property Parent As SolutionBuild
SolutionBuild Parent { get; }
property SolutionBuild^ Parent {
    SolutionBuild^ get ();
}
abstract Parent : SolutionBuild
function get Parent () : SolutionBuild

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

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

Заметки

СвойствоParent возвращает ближайший родительский объект коллекции BuildDependencies.

Примеры

public void Example(DTE2 dte)
{

   try
   {
      BuildDependencies bldDepends;
      SolutionBuild slnBuild;

      // Get the BuildDependencies in open solution.
      bldDepends = dte.Solution.SolutionBuild.BuildDependencies;
      // Get the SolutionBuild.
      slnBuild = dte.Solution.SolutionBuild;
      // Show the number of Build Dependencies in open solution.
      MessageBox.Show("Number of dependencies: " + bldDepends.Count.ToString());
      // Prove that Build Dependencies parent object is a SolutionBuild object.
      if (bldDepends.Parent.GetType().Equals(slnBuild.GetType()))
         MessageBox.Show("Types match");
      else
         MessageBox.Show("Types do not match");
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}

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

См. также

Ссылки

BuildDependencies Интерфейс

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

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

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