_dispVCProjectEngineEvents.ProjectBuildFinished 方法

此 API 支持 .NET Framework 基础结构,不适合在代码中直接使用。

指示项目生成已完成。

命名空间:  Microsoft.VisualStudio.VCProjectEngine
程序集:  Microsoft.VisualStudio.VCProjectEngine(在 Microsoft.VisualStudio.VCProjectEngine.dll 中)

语法

声明
Sub ProjectBuildFinished ( _
    Cfg As Object, _
    warnings As Integer, _
    errors As Integer, _
    Cancelled As Boolean _
)
void ProjectBuildFinished(
    Object Cfg,
    int warnings,
    int errors,
    bool Cancelled
)
void ProjectBuildFinished(
    [InAttribute] Object^ Cfg, 
    [InAttribute] int warnings, 
    [InAttribute] int errors, 
    [InAttribute] bool Cancelled
)
abstract ProjectBuildFinished : 
        Cfg:Object * 
        warnings:int * 
        errors:int * 
        Cancelled:bool -> unit 
function ProjectBuildFinished(
    Cfg : Object, 
    warnings : int, 
    errors : int, 
    Cancelled : boolean
)

参数

  • Cancelled
    类型:System.Boolean
    必需。如果生成被取消,则为 True;否则为 false。

备注

Visual Studio 集成开发环境 (ide) 调用的由自动化程序编译,或者 (IDE),通常是后台进程。 ProjectBuildFinished 很有用,因为它使您的程序暂停直到由您的程序启动完成的生成的执行。

示例

[Visual Basic]

' add reference to Microsoft.VisualStudio.VCProjectEngine
Imports EnvDTE
Imports Microsoft.VisualStudio.VCProjectEngine

Public Module Module1
    Sub ProjectBuildFinished(ByVal Cfg As Object, _
 ByVal Warnings As Integer, ByVal errors As Integer, _
 ByVal Canceled As Boolean)
        MsgBox(Warnings)
    End Sub
    Sub Main()
        Dim projEngine As VCProjectEngine
        Dim prj As VCProject
        Dim evt As VCProjectEngineEvents
        Dim cfgs As IVCCollection
        Dim cfg As VCConfiguration
        prj = DTE.Solution.Projects.Item(1).Object
        projEngine = prj.VCProjectEngine
        evt = projEngine.Events
        AddHandler evt.ProjectBuildFinished, AddressOf ProjectBuildFinished
        cfgs = prj.Configurations
        cfg = cfgs.Item(1)
        cfg.Build()
    End Sub
End Module

.NET Framework 安全性

请参见

参考

_dispVCProjectEngineEvents 接口

Microsoft.VisualStudio.VCProjectEngine 命名空间