TaskExtension 基类TaskExtension base class

很多任务继承自 TaskExtension 类,该类本身继承自 Task 类。Many tasks inherit from the TaskExtension class, which itself inherits from the Task class. 此继承链向从它们派生的任务添加了几个参数。This inheritance chain adds several parameters to the tasks that derive from them. 本文档中列出了这些参数。These parameters are listed in this document.

参数Parameters

下表介绍基类的参数。The following table describes the parameters of the base classes.

参数Parameter 说明Description
BuildEngine 可选 IBuildEngine 参数。Optional IBuildEngine parameter.

指定可供任务使用的生成引擎接口。Specifies the build engine interface available to tasks. 生成引擎会自动设置此参数,以允许任务回调到其中。The build engine automatically sets this parameter to allow tasks to call back into it.
BuildEngine2 可选 IBuildEngine2 参数。Optional IBuildEngine2 parameter.

指定可供任务使用的生成引擎接口。Specifies the build engine interface available to tasks. 生成引擎会自动设置此参数,以允许任务回调到其中。The build engine automatically sets this parameter to allow tasks to call back into it.

这是一个便捷属性,使从此类继承的任务作者不必将值从 IBuildEngine 强制转换为 IBuildEngine2This is a convenience property so that task authors inheriting from this class do not have to cast the value from IBuildEngine to IBuildEngine2.
BuildEngine3 可选 IBuildEngine3 参数。Optional IBuildEngine3 parameter.

指定主机使用的生成引擎接口。Specifies the build engine interface provided by the host.
HostObject 可选 ITaskHost 参数。Optional ITaskHost parameter.

指定主机对象实例(可以为 null)。Specifies the host object instance (can be null). 如果主机 IDE 具有与此特定任务关联的主机对象,则生成引擎会设置此属性。The build engine sets this property if the host IDE has associated a host object with this particular task.
Log 可选 TaskLoggingHelper 只读参数。Optional TaskLoggingHelper read-only parameter.

获取包含任务日志记录方法的 TaskLoggingHelperExtension 对象。Gets a TaskLoggingHelperExtension object that contains task logging methods.

另请参阅See also