Share via


Using the EventHandlingScopeActivity Activity

An EventHandlingScopeActivity activity executes its main child activity concurrently with an EventHandlersActivity activity. Each EventDrivenActivity in the EventHandlersActivity activity might execute many times, or not at all.

The following example shows this concept using XML.

<EventHandlingScopeActivity>
   <SequenceActivity>
      <DoSomething />
      <DoSomethingElse />
   </SequenceActivity>
   <EventHandlersActivity>
      <EventDrivenActivity1>
         <!--Receive Cancel Message-->
      </EventDrivenActivity1>
      <EventDrivenActivity2>
         <!--Timer-->
      </EventDrivenActivity2>
   </EventHandlersActivity>
</EventHandlingScopeActivity>

In the example, the EventHandlingScopeActivity activity executes the SequenceActivity activity, which is its main child activity. At the same time, each EventDrivenActivity may or may not execute depending on whether their events, in this case a cancel message or timer expiration, occur while the SequenceActivity activity is executing.

See Also

Reference

EventHandlersActivity
EventHandlingScopeActivity

Concepts

Using the EventDrivenActivity Activity

Other Resources

Windows Workflow Foundation Activities