ICancelableTask 接口

定义

可以取消的任务的接口。Interface for tasks which can be cancelled.

public interface class ICancelableTask : Microsoft::Build::Framework::ITask
public interface ICancelableTask : Microsoft.Build.Framework.ITask
type ICancelableTask = interface
    interface ITask
Public Interface ICancelableTask
Implements ITask
派生
实现

属性

BuildEngine

此属性由生成引擎设置为允许任务回调到其中。This property is set by the build engine to allow a task to call back into it.

(继承自 ITask)
HostObject

如果主机 IDE 具有与此特定任务关联的主机对象,则生成引擎会设置此属性。The build engine sets this property if the host IDE has associated a host object with this particular task.

(继承自 ITask)

方法

Cancel()

指示任务尽快退出,如果在此方法之后调用了 Execute,则指示任务立即退出。Instructs the task to exit as soon as possible, or to immediately exit if Execute is invoked after this method.

Execute()

此方法由生成引擎调用以开始执行任务。This method is called by the build engine to begin task execution. 任务使用返回值来指示是否成功。A task uses the return value to indicate whether it was successful. 如果任务在此方法中引发异常,则引擎将自动假定任务已失败。If a task throws an exception out of this method, the engine will automatically assume that the task has failed.

(继承自 ITask)

适用于