ActivityExecutionContext 类

定义

警告

此 API 现已过时。

表示 Activity 的执行环境。Represents the execution environment of an Activity. 此类不能被继承。This class cannot be inherited.

public ref class ActivityExecutionContext sealed : IDisposable, IServiceProvider
[System.Obsolete("The System.Workflow.* types are deprecated.  Instead, please use the new types from System.Activities.*")]
public sealed class ActivityExecutionContext : IDisposable, IServiceProvider
type ActivityExecutionContext = class
    interface IServiceProvider
    interface IDisposable
Public NotInheritable Class ActivityExecutionContext
Implements IDisposable, IServiceProvider
继承
ActivityExecutionContext
属性
实现

注解

备注

本材料讨论的类型和命名空间已废弃不用。This material discusses types and namespaces that are obsolete. 有关详细信息,请参阅 Windows Workflow Foundation 4.5 中弃用的类型For more information, see Deprecated Types in Windows Workflow Foundation 4.5.

表示 Activity 的执行环境。Represents the execution environment of an Activity. 此类有选择地向单个活动公开工作流运行时的功能和服务。This class selectively exposes workflow runtime capabilities and services to individual activities. 此类不能被继承。This class cannot be inherited.

有关详细信息, 请参阅了解活动执行上下文For more information, see Understanding the Activity Execution Context.

字段

CurrentExceptionProperty

表示在工作流实例的执行期间发生的异常。Represents an exception that has occurred during the execution of the workflow instance. 只有当活动处于出错状态时,此属性才会有值。This property has a value only when an activity is in the faulting state.

属性

Activity

获取当前在此执行上下文中执行的 ActivityGets the Activity that currently executes within this execution context.

ContextGuid

获取关联 ContextIDActivityGets the ContextID of the associated Activity.

ExecutionContextManager

获取与此实例关联的 ActivityExecutionContextManagerGets the ActivityExecutionContextManager associated with this instance.

方法

CancelActivity(Activity)

由复合活动调用,用于计划子活动的取消。Called by a composite activity to schedule the cancellation of a child activity. 工作流运行时禁止取消未处于 Executing 状态的子活动。The workflow runtime disallows cancellation of a child activity that is not in the Executing state.

CloseActivity()

向工作流运行时指示:当前正在执行的活动应转换为 Closed 状态。Indicates to the workflow runtime that the currently executing activity should transition to the Closed state.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
ExecuteActivity(Activity)

由复合活动调用,用于计划子活动的执行。Called by a composite activity to schedule the execution of a child activity. 工作流运行时禁止执行未处于已初始化状态的子活动。The workflow runtime disallows execution of a child activity that is not in the initialized state.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetService(Type)

返回指定类型的服务。Returns a service of the specified type.

GetService<T>()

返回指定的 Type 的服务提供程序。Returns a service provider of the specified Type.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)
TrackData(Object)

为关联的 Activity 调用跟踪方法。Invokes the track method for the associated Activity.

TrackData(String, Object)

为关联的 Activity 调用跟踪方法。Invokes the track method for the associated Activity.

显式接口实现

IDisposable.Dispose()

释放由 ActivityExecutionContext 使用的所有资源。Releases all resources used by the ActivityExecutionContext.

适用于