//Loads the workflow definition into the designer internal void OpenWorkflow(Activity workflowDefinition) { Initialize(); IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); if (host == null) { return; } if (this.workflowViewValue != null) { if (Controls.Contains(this.workflowViewValue)) { Controls.Remove(this.workflowViewValue); } this.workflowViewValue.Dispose(); this.workflowViewValue = null; } loader.WorkflowDefinition = workflowDefinition; this.surface.BeginLoad(this.loader); this.workflowViewValue = new WorkflowView(this.surface); workflowViewValue.ZoomChanged += new EventHandler(workflowViewValue_ZoomChanged); IDesignerGlyphProviderService glyphService = this.surface.GetService(typeof(IDesignerGlyphProviderService)) as IDesignerGlyphProviderService; WorkflowMonitorDesignerGlyphProvider glyphProvider = new WorkflowMonitorDesignerGlyphProvider(parentValue.ActivityStatusList); glyphService.AddGlyphProvider(glyphProvider); workflowViewValue.Dock = DockStyle.Fill; Controls.Add(workflowViewValue); ((IDesignerLoaderHost)host).EndLoad(host.RootComponent.Site.Name, true, null); }
//Loads the workflow definition into the designer internal void OpenWorkflow(Activity workflowDefinition) { Initialize(); IDesignerHost host = (IDesignerHost)GetService(typeof(IDesignerHost)); if (host == null) return; if (this.workflowViewValue != null) { if(Controls.Contains(this.workflowViewValue)) Controls.Remove(this.workflowViewValue); this.workflowViewValue.Dispose(); this.workflowViewValue = null; } loader.WorkflowDefinition = workflowDefinition; this.surface.BeginLoad(this.loader); this.workflowViewValue = new WorkflowView(this.surface); workflowViewValue.ZoomChanged += new EventHandler(workflowViewValue_ZoomChanged); IDesignerGlyphProviderService glyphService = this.surface.GetService(typeof(IDesignerGlyphProviderService)) as IDesignerGlyphProviderService; WorkflowMonitorDesignerGlyphProvider glyphProvider = new WorkflowMonitorDesignerGlyphProvider(parentValue.ActivityStatusList); glyphService.AddGlyphProvider(glyphProvider); workflowViewValue.Dock = DockStyle.Fill; Controls.Add(workflowViewValue); ((IDesignerLoaderHost)host).EndLoad(host.RootComponent.Site.Name, true, null); }