Should WorkItem be apart of Iworkspace?

Topics: CAB & Smart Client Software Factory
Oct 20, 2005 at 11:43 AM
originally posted by: Kidd_Kane

Looking at the new Workspace implementations I noticed the use of WorkItem in all the Workspaces. The seems to be there to support ISmartPartInfo registration at the workspace level. This is great and all, but workItem is not actually a part of the interface so I have to either use reflection or a bunch of is checks to see if my IWorkspace implementation is an implementation that has WorkItem on it.

How does this affect me? Well when you do RegisterSmartPartInfo it only registers with the local workitem, but if the workspace was created in a separate workitem then the GetSmartPartInfo call within the workspace will only check the info of the workitem it was created in.

I could make use of the WorkItem property and directly register the ISmartPartInfo with the WorkItem the workSpace refers to, but since WorkItem is not a part of the IWorkspace interface this is hairy.

A possible solution is to do all registration and checking of smartpartinfo at the RootworkItem level, but this will not work in what I am planning to do in the future, which is to have multiple sessions with different views and permissions active/ and the user can switch sessions on the fly. Here my session object would be a workitem, and the session will then act as a "virtual" RootWorkItem.

Any plans on correcting or fixing this? If not do you have any good work arounds?