BuildDependency.Collection 屬性

傳回包含支援此屬性之 BuildDependency 物件的 BuildDependencies 集合。

命名空間:  EnvDTE
組件:  EnvDTE (在 EnvDTE.dll 中)

語法

'宣告
ReadOnly Property Collection As BuildDependencies
    Get
BuildDependencies Collection { get; }
property BuildDependencies^ Collection {
    BuildDependencies^ get ();
}
abstract Collection : BuildDependencies
function get Collection () : BuildDependencies

屬性值

型別:EnvDTE.BuildDependencies
BuildDependencies 集合。

範例

public void Example(DTE2 dte, AddIn addin)
{
   try
   {
      // Make sure there is at least one BuildDependency in your
      // solution to run this code.
      BuildDependencies bldDepends;
      BuildDependency bldDependency = null;

      bldDepends = dte.Solution.SolutionBuild.BuildDependencies;
      if (bldDepends.Count > 0)
         bldDependency = bldDepends.Item(bldDepends.Count);

      // 
      if (bldDependency.Collection.Count > 0)
         MessageBox.Show(bldDependency.DTE.Name);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }
}

.NET Framework 安全性

請參閱

參考

BuildDependency 介面

EnvDTE 命名空間

其他資源

HOW TO:編譯和執行 Automation 物件模型程式碼範例