How to get to the WorkItemController via WorkItems

Topics: CAB & Smart Client Software Factory
Oct 19, 2006 at 5:25 AM
originally posted by: MJMaster

Here is what we are trying to do:

We need to get access to a WorkItemController for our modules without knowledge of the type of the module's WorkItemController derived instance.

For example, if we iterate over the rootWorkItem.WorkItems collection, we can see each instance of a ControlledWorkItem<DerivedWorkItemControllerType>. For certain instances of ControlledWorkItems in that collection, we want to call a method on the base WorkItemController. However, casting the ControlledWorkItem<DerivedWorkItemControllerType> to ControlledWorkItem<BaseWorkItemController> doesn't work.

Any ideas on how we can accomplish this? We understand we could do this via events, but we have the knowledge to be able to call the method on the specific WorkItemController we care about, versus shortcircuiting for all the other WorkItemControllers in the case of using Events.

Thanks in advance!