SetStateEventArgs 类
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*
表示一个类,该类用作设置 StateMachineWorkflowActivity 状态的一个参数。
public ref class SetStateEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(false)]
[System.Serializable]
public class SetStateEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(false)]
[System.Serializable]
[System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public class SetStateEventArgs : EventArgs
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Serializable>]
type SetStateEventArgs = class
inherit EventArgs
[<System.Runtime.InteropServices.ComVisible(false)>]
[<System.Serializable>]
[<System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")>]
type SetStateEventArgs = class
inherit EventArgs
Public Class SetStateEventArgs
Inherits EventArgs
- 继承
- 属性
备注
本材料讨论的类型和命名空间已废弃不用。 有关详细信息,请参阅 Windows Workflow Foundation 4.5 中弃用的类型。
StateMachineWorkflowActivity 允许从主机应用程序设置状态。 这将使主机应用程序能够重写状态机的当前状态。 为此,可以将 SetStateEventArgs 类的一个实例排入由常量 StateMachineWorkflowActivity.SetStateQueueName 命名的 WorkflowQueue 队列中。
完成此操作的较为简便的方法是使用 SetState 类中的 StateMachineWorkflowInstance 方法。
可以使用 SetState 方法从宿主执行 SetState 操作,或者可以通过将事件排入状态机工作流来亲自执行此操作,如下面的示例所示。
public void SetState(string targetStateName)
{
if (targetStateName == null)
{
throw new ArgumentNullException("targetStateName");
}
SetStateEventArgs args1 = new SetStateEventArgs(targetStateName);
this.WorkflowInstance.EnqueueItemOnIdle("SetStateQueue", args1, null, null);
}
状态机工作流使用名为 SetStateQueue
的特殊队列来侦听这些特殊事件。
Set |
已过时.
初始化 SetStateEventArgs 类的新实例。 |
Target |
已过时.
获取要将 StateActivity 设置到的状态。 |
Equals(Object) |
已过时.
确定指定对象是否等于当前对象。 (继承自 Object) |
Get |
已过时.
作为默认哈希函数。 (继承自 Object) |
Get |
已过时.
获取当前实例的 Type。 (继承自 Object) |
Memberwise |
已过时.
创建当前 Object 的浅表副本。 (继承自 Object) |
To |
已过时.
返回表示当前对象的字符串。 (继承自 Object) |
产品 | 版本 (已过时) |
---|---|
.NET Framework | 3.0, 3.5, 4.0 (4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1) |