IDocumentPersistenceService and SourceLocationProvider.CollectMapping RRS feed

  • Question

  • So it seems all the examples of visual tracking in a rehosted designer use XAML files as the designer source.  When executing the workflow, a visual tracking record is generated for each activity executed, and a dictionary is then used to determine the source location for that activity, and the debugger service is used to adorn (hilight) the activity [designer] in the rehosted designer by setting the CurrentLocation property.  To allow the user a chance to see the adornment, a timeout of one second is generated, and the process repeats until the workflow is done.  Great.

    The problem that I've encountered is that the key component to get this working is the dictionary that maps the activity(id) --> source location.  Part of this is done when calling SourceLocationProvider.CollectMapping() to walk the designer activity tree and create mapping entries between the activity and its source location in the XAML file.  However, if I'm using a custom IDocumentPersistenceService to provide the contents of the file, then CollectMapping does not work.


    At the moment I'm trying to figure out another way to create this mapping.

    I'm also curious to know if the visual tracking examples would even work on a machine that doesn't have Visual Studio installed, since I believe the debugging features (and therefore, IDebuggerService.CurrentLocation, which actually provides the adornment) of a rehosted designer would be dependent upon the Visual Studio assemblies rather than the base Framework assemblies.  If the adornment requires Visual Studio assemblies, then I'd rather implement the adornment myself, and then I wouldn't need to map activities to source locations, but would then simply need to figure out a way to determine the WPF DependencyObject from the Activity passed into the TrackingParticipant event handler.

    Thursday, May 5, 2011 7:00 PM


  • You can check the assembly reference. Some assemblies like Microsoft.VisualStudio.Activities.dll do come from Visual Studio which isn't re-distributable.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    • Marked as answer by Andrew_Zhu Tuesday, May 24, 2011 8:24 AM
    Wednesday, May 11, 2011 11:13 AM