BuildManager 介面
協力廠商開發人員用來管理由執行自訂工具所產生的可移植執行檔 (PE)。
命名空間: VSLangProj
組件: VSLangProj (在 vslangproj.dll 中)
語法
'宣告
<GuidAttribute("C711E2B7-3C58-4C37-9359-705208A890AE")> _
Public Interface BuildManager
'用途
Dim instance As BuildManager
[GuidAttribute("C711E2B7-3C58-4C37-9359-705208A890AE")]
public interface BuildManager
[GuidAttribute(L"C711E2B7-3C58-4C37-9359-705208A890AE")]
public interface class BuildManager
/** @attribute GuidAttribute("C711E2B7-3C58-4C37-9359-705208A890AE") */
public interface BuildManager
GuidAttribute("C711E2B7-3C58-4C37-9359-705208A890AE")
public interface BuildManager
備註
BuildManager 提供對專案中暫存 PE 的存取 (從自訂工具輸出來建立)。如需詳細資訊,請參閱 BuildManager 物件簡介 和 RunCustomTool 方法。
範例
以下範例將列出專案中暫存 PE 的所有 Moniker。只有將 CustomTool 屬性設定為自訂工具 (產生設計階段輸出) 的專案項目才有相關的 Moniker。檢視 Moniker 的一種簡單方式是建立 Windows 應用程式專案並加入 XML 結構描述專案項目。XML 結構描述專案項目會將 CustomTool 屬性設定為 MSDataSetGenerator。
' Macro editor
Sub BuildManagerExample()
Try
Dim proj As VSLangProj.VSProject = _
CType(DTE.Solution.Projects.Item(1).Object, VSLangProj.VSProject)
Dim build As BuildManager = proj.BuildManager
Dim monikers As String() = _
CType(build.DesignTimeOutputMonikers, String())
Dim moniker As String
' List the monikers.
For Each moniker In monikers
MsgBox(moniker & ControlChars.CrLf & _
build.BuildDesignTimeOutput(moniker))
Next
' Hook up some events.
Dim buildEvents As BuildManagerEvents = _
proj.Events.BuildManagerEvents
AddHandler buildEvents.DesignTimeOutputDeleted, _
AddressOf OutputDeleted
AddHandler buildEvents.DesignTimeOutputDirty, _
AddressOf OutputDirty
Catch ex As System.Exception
MsgBox("Cannot list monikers and hook up events.")
End Try
End Sub
Sub OutputDeleted(ByVal deletedMoniker As String)
MsgBox(deletedMoniker & " was deleted.")
End Sub
Sub OutputDirty(ByVal dirtyMoniker As String)
MsgBox(dirtyMoniker & " is dirty.")
End Sub