-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
EventDrivenActivity.xml
176 lines (156 loc) · 13.5 KB
/
EventDrivenActivity.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<Type Name="EventDrivenActivity" FullName="System.Workflow.Activities.EventDrivenActivity">
<TypeSignature Language="C#" Value="public sealed class EventDrivenActivity : System.Workflow.Activities.SequenceActivity" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit EventDrivenActivity extends System.Workflow.Activities.SequenceActivity" />
<TypeSignature Language="DocId" Value="T:System.Workflow.Activities.EventDrivenActivity" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class EventDrivenActivity
Inherits SequenceActivity" />
<TypeSignature Language="F#" Value="type EventDrivenActivity = class
 inherit SequenceActivity" />
<TypeSignature Language="C++ CLI" Value="public ref class EventDrivenActivity sealed : System::Workflow::Activities::SequenceActivity" />
<AssemblyInfo>
<AssemblyName>System.Workflow.Activities</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Workflow.Activities.SequenceActivity</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.Designer(typeof(System.Workflow.Activities.EventDrivenDesigner), typeof(System.ComponentModel.Design.IDesigner))]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Designer(typeof(System.Workflow.Activities.EventDrivenDesigner), typeof(System.ComponentModel.Design.IDesigner))>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.ToolboxItem(typeof(System.Workflow.ComponentModel.Design.ActivityToolboxItem))]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.ToolboxItem(typeof(System.Workflow.ComponentModel.Design.ActivityToolboxItem))>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Drawing.ToolboxBitmap(typeof(System.Workflow.Activities.EventDrivenActivity), "Resources.EventDriven.png")]</AttributeName>
<AttributeName Language="F#">[<System.Drawing.ToolboxBitmap(typeof(System.Workflow.Activities.EventDrivenActivity), "Resources.EventDriven.png")>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Workflow.ComponentModel.Compiler.ActivityValidator(typeof(System.Workflow.Activities.EventDrivenValidator))]</AttributeName>
<AttributeName Language="F#">[<System.Workflow.ComponentModel.Compiler.ActivityValidator(typeof(System.Workflow.Activities.EventDrivenValidator))>]</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]</AttributeName>
<AttributeName Language="F#">[<System.Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Wraps an <see cref="T:System.Workflow.ComponentModel.Activity" /> whose execution is initialized by an event. This class cannot be inherited.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!NOTE]
> [!INCLUDE[DeprecatedContent](~/includes/deprecatedcontent-md.md)]
It is a <xref:System.Workflow.ComponentModel.CompositeActivity> that is used to handle an event; typically it can be raised from the host or by the runtime in response to a delay timer expiring. <xref:System.Workflow.Activities.EventDrivenActivity> is inherited from <xref:System.Workflow.Activities.SequenceActivity>; therefore, it is a sequence that has the additional restriction that the first activity should be an <xref:System.Workflow.Activities.IEventActivity>.
The <xref:System.Workflow.Activities.EventDrivenActivity> is a <xref:System.Workflow.ComponentModel.CompositeActivity>, which means the <xref:System.Workflow.Activities.EventDrivenActivity> can contain other activities. The <xref:System.Workflow.Activities.EventDrivenActivity> is similar to the <xref:System.Workflow.Activities.SequenceActivity> activity, with some additional characteristics.
An <xref:System.Workflow.Activities.EventDrivenActivity> must have a parent that is either a <xref:System.Workflow.Activities.ListenActivity>, <xref:System.Workflow.Activities.StateActivity>, or <xref:System.Workflow.Activities.StateMachineWorkflowActivity>.
The first child of an <xref:System.Workflow.Activities.EventDrivenActivity> activity must be an activity that inherits from <xref:System.Workflow.Activities.IEventActivity>. All subsequent children can be activities of any type. The <xref:System.Workflow.Activities.IEventActivity> blocks and waits for the pending occurrence of some events, such as starting a timer or the arrival of a message. When the event occurs, the <xref:System.Workflow.Activities.IEventActivity> finishes running and then all subsequent activities are executed.
When the <xref:System.Workflow.Activities.StateMachineWorkflowActivity> contains an <xref:System.Workflow.Activities.EventDrivenActivity>, the <xref:System.Workflow.Activities.EventDrivenActivity> has some restrictions:
- The <xref:System.Workflow.Activities.EventDrivenActivity> may contain one, and only one, activity of type <xref:System.Workflow.Activities.IEventActivity>.
- The <xref:System.Workflow.Activities.HandleExternalEventActivity> must be the first child activity. An <xref:System.Workflow.Activities.HandleExternalEventActivity> cannot be in the event handler for a child activity and cannot be a child to the <xref:System.Workflow.Activities.EventDrivenActivity> if the <xref:System.Workflow.Activities.HandleExternalEventActivity> is not the first child.
- As long as the first activity is the <xref:System.Workflow.Activities.HandleExternalEventActivity>, the event handler can contain any activities. If an activity other than <xref:System.Workflow.Activities.HandleExternalEventActivity> is contained in <xref:System.Workflow.Activities.EventDrivenActivity>, that activity cannot have an event handler.
For example, an activity that supports event handling can be used inside the <xref:System.Workflow.Activities.EventDrivenActivity> but the activity cannot have event handlers attached to itself.
Another example is that the <xref:System.Workflow.Activities.EventDrivenActivity> can contain a <xref:System.Workflow.Activities.ConditionedActivityGroup>, but the <xref:System.Workflow.Activities.ConditionedActivityGroup> itself cannot contain any <xref:System.Workflow.Activities.HandleExternalEventActivity> classes.
## Examples
The following code example shows how to use the <xref:System.Workflow.Activities.EventDrivenActivity> to perform state machine transitions. This code example is part of the SimpleStateMachineWorkflow SDK sample from the StateMachineWorkflow.cs file. For more information, see [Simple State Machine](https://msdn.microsoft.com/library/1974edbd-253d-4e01-9095-38ff9c3e749e).
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wf_samples/cs/snippets19.cs" id="Snippet185":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/wf_samples/vb/snippets19.vb" id="Snippet185":::
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/dotnet/netframework-3.5/ms734657(v=vs.90)">Using the EventDriven Activity</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Workflow.Activities</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Workflow.Activities.EventDrivenActivity" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public EventDrivenActivity ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Workflow.Activities.EventDrivenActivity.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 EventDrivenActivity();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Workflow.Activities</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Workflow.Activities.EventDrivenActivity" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example shows how to create a new instance of the <xref:System.Workflow.Activities.EventDrivenActivity> class. This code example is part of the SimpleStateMachineWorkflow SDK sample from the StateMachineWorkflow.cs file. For more information, see [Simple State Machine](https://msdn.microsoft.com/library/1974edbd-253d-4e01-9095-38ff9c3e749e).
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_CFX/wf_samples/cs/snippets19.cs" id="Snippet187":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CFX/wf_samples/vb/snippets19.vb" id="Snippet187":::
]]></format>
</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/dotnet/netframework-3.5/ms734657(v=vs.90)">Using the EventDriven Activity</related>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public EventDrivenActivity (string name);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string name) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Workflow.Activities.EventDrivenActivity.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (name As String)" />
<MemberSignature Language="F#" Value="new System.Workflow.Activities.EventDrivenActivity : string -> System.Workflow.Activities.EventDrivenActivity" Usage="new System.Workflow.Activities.EventDrivenActivity name" />
<MemberSignature Language="C++ CLI" Value="public:
 EventDrivenActivity(System::String ^ name);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Workflow.Activities</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="name" Type="System.String" />
</Parameters>
<Docs>
<param name="name">The user-identified name of the activity.</param>
<summary>Initializes a new instance of the <see cref="T:System.Workflow.Activities.EventDrivenActivity" /> class using the name of the activity.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="EventActivity">
<MemberSignature Language="C#" Value="public System.Workflow.Activities.IEventActivity EventActivity { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Workflow.Activities.IEventActivity EventActivity" />
<MemberSignature Language="DocId" Value="P:System.Workflow.Activities.EventDrivenActivity.EventActivity" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property EventActivity As IEventActivity" />
<MemberSignature Language="F#" Value="member this.EventActivity : System.Workflow.Activities.IEventActivity" Usage="System.Workflow.Activities.EventDrivenActivity.EventActivity" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Workflow::Activities::IEventActivity ^ EventActivity { System::Workflow::Activities::IEventActivity ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Workflow.Activities</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.Browsable(false)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.Browsable(false)>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Workflow.Activities.IEventActivity</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the event activity that drives the change.</summary>
<value>The event activity that drives the change.</value>
<remarks>To be added.</remarks>
<related type="Article" href="https://learn.microsoft.com/previous-versions/dotnet/netframework-3.5/ms734657(v=vs.90)">Using the EventDriven Activity</related>
</Docs>
</Member>
</Members>
</Type>