iterate through workitems

Topics: CAB & Smart Client Software Factory
Sep 28, 2006 at 4:09 AM
originally posted by: wanderer1

How do you iterate (using foreach) through the workitems? In the parent workitem, I want to iterate through all the children workitems and fire some events for these workitems. Any ideas?

Thanks.
Sep 28, 2006 at 7:19 PM
originally posted by: marianoszklanny

One way to do it could be the following:

void IterateWIs(WorkItem workItem)
{
foreach (KeyValuePair<string, WorkItem> childWorkItem in workItem.WorkItems)
{
// do something
if (childWorkItem.Value.WorkItems.Count > 0)
IterateWIs(childWorkItem.Value);
}
}

Cheers,
Mariano Szklanny
http://staff.southworks.net/mariano
Oct 3, 2006 at 12:55 AM
originally posted by: wanderer1

Thanks, I will try it.