WF Designer: Glyph provider is not being used by my viewer
Hi all,
I have a web page that displays the workflow image for a given workflow instance id. I based this code on the WorkflowMonitor in the June CTP SDK. To avoid CAS issues, my workflowViewer saves the workflow image as a stream which is returned to the web page for rendering (as opposed to hosting a designer surface directly in a web page).
This is working fine, however I am unable to hook in the glyph provider to mark Closed and Executing activities, as is done in the SDK.
Here's the relevant code extract:
IDesignerGlyphProviderService glyphService = (IDesignerGlyphProviderService)designSurface.GetService(typeof(IDesignerGlyphProviderService));
WorkflowMonitorDesignerGlyphProvider glyphProvider = new WorkflowMonitorDesignerGlyphProvider(activityStatusListValue);
glyphService.AddGlyphProvider(glyphProvider);
using (workflowView = new WorkflowView(designSurface))
{
workflowView.Dock = DockStyle.Fill;
((IDesignerLoaderHost)designerHost).EndLoad(designerHost.RootComponent.Site.Name, true, null);
workflowView.SaveWorkflowImage(stream, imageInfo.ImageFormat);
}
return stream;
The WorkflowMonitorDesignerGlyphProvider is identical to the corresponding class in the SDK.
When I debug the SDK WorkflowMonitor I see that the IDesignerGlyphProvider.GetGlyphs in the Glyph provider is called at some point after the .EndLoad() call. However in my implementation, GetGlyphs is never called and I am trying to find out why?
I thought perhaps this is because I don't have a control container that my workflow viewer is added to. In my case I keep the workflow viewer in memory, save the workflow image as a stream, then dispose. I tried creating a temporary form control object and adding the workflowView to it to see if that would trigger the GetGlyphs call - but it didn't.
So, does anyone know what calls the GetGlyph method of the Glyph provider and how I might go about invoking this myself to mimic what happens in the win form environment.
Any and all help is greatly appreciated.
Thanks
Steve

