ExternalDataEventArgs 类
定义
注意
The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*
表示在使用 HandleExternalEventActivity 活动引发事件时发送的数据。Represents the data sent when an event is raised using the HandleExternalEventActivity activity.
public ref class ExternalDataEventArgs : EventArgs
[System.Serializable]
public class ExternalDataEventArgs : EventArgs
[System.Serializable]
[System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public class ExternalDataEventArgs : EventArgs
[<System.Serializable>]
type ExternalDataEventArgs = class
inherit EventArgs
[<System.Serializable>]
[<System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")>]
type ExternalDataEventArgs = class
inherit EventArgs
Public Class ExternalDataEventArgs
Inherits EventArgs
- 继承
- 属性
示例
从 ExternalDataEventArgs 继承的事件类必须实现一个构造函数,该构造函数使用 :base(instanceId) 构造函数。An event class that inherits from ExternalDataEventArgs must implement a constructor that uses the :base(instanceId) constructor. 此外,必须将新的事件类标记为 Serializable,如下面的代码所示。In addition, the new event class must be marked as Serializable as shown in the following code.
[Serializable]
public class TaskEventArgs : ExternalDataEventArgs
{
private string orderName;
public TaskEventArgs(Guid instanceId, string id)
:base(instanceId)
{
orderName = id;
}
public string Id
{
get { return orderName; }
set { orderName = value; }
}
}
注解
备注
本材料讨论的类型和命名空间已废弃不用。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.
若要在工作流中与 ExternalDataExchangeAttribute 活动一起处理相应的事件,标记为 ExternalDataEventArgs 的本地通信接口必须在接口定义中声明一个派生自 HandleExternalEventActivity 的类型。A local communication interface marked with ExternalDataExchangeAttribute must declare a type that derives from ExternalDataEventArgs in the interface definition for the corresponding event to be handled in a workflow with a HandleExternalEventActivity activity.
构造函数
| ExternalDataEventArgs() |
初始化 ExternalDataEventArgs 类的新实例。Initializes a new instance of the ExternalDataEventArgs class. |
| ExternalDataEventArgs(Guid) |
使用工作流的实例标识符初始化 ExternalDataEventArgs 类的新实例。Initializes a new instance of the ExternalDataEventArgs class using the instance identifier of the workflow. |
| ExternalDataEventArgs(Guid, IPendingWork, Object) |
初始化 ExternalDataEventArgs 类的新实例。Initializes a new instance of the ExternalDataEventArgs class. |
| ExternalDataEventArgs(Guid, IPendingWork, Object, Boolean) |
初始化 ExternalDataEventArgs 类的新实例。Initializes a new instance of the ExternalDataEventArgs class. |
属性
| Identity |
获取或设置引发事件的用户的标识。Gets or sets the identity of the user that raised the event. |
| InstanceId |
获取或设置包含应处理该事件的 HandleExternalEventActivity 的工作流实例的工作流实例标识符。Gets or sets the workflow instance identifier for the workflow instance that contains the HandleExternalEventActivity that is expected to handle the event. |
| WaitForIdle |
获取或设置值,该值指示是应立即引发事件,还是工作流在引发事件前应处于空闲状态。Gets or sets a value that indicates whether the event should be raised immediately, or if the workflow should go idle before raising the event. |
| WorkHandler |
获取或设置允许引发事件的外部代码参与批处理的 IPendingWork。Gets or sets the IPendingWork to allow the external code, raising the event, to participate in the batch. |
| WorkItem |
获取或设置包含引发事件的外部代码的对象。Gets or sets the object that contains the external code that raises the event. |
方法
| Equals(Object) |
确定指定对象是否等于当前对象。Determines whether the specified object is equal to the current object. (继承自 Object) |
| GetHashCode() |
作为默认哈希函数。Serves as the default hash function. (继承自 Object) |
| GetType() |
获取当前实例的 Type。Gets the Type of the current instance. (继承自 Object) |
| MemberwiseClone() |
创建当前 Object 的浅表副本。Creates a shallow copy of the current Object. (继承自 Object) |
| ToString() |
返回表示当前对象的字符串。Returns a string that represents the current object. (继承自 Object) |