/// <summary> /// Dispose of connect actions. /// </summary> protected override void Dispose(bool disposing) { try { if (disposing) { if (this.hostApplicationCreateAction != null) { this.hostApplicationCreateAction.Dispose(); this.hostApplicationCreateAction = null; } if (this.serviceCreateAction != null) { this.serviceCreateAction.Dispose(); this.serviceCreateAction = null; } if (this.endpointCreateAction != null) { this.endpointCreateAction.Dispose(); this.endpointCreateAction = null; } if (this.clientApplicationCreateAction != null) { this.clientApplicationCreateAction.Dispose(); this.clientApplicationCreateAction = null; } if (this.proxyCreateAction != null) { this.proxyCreateAction.Dispose(); this.proxyCreateAction = null; } if (this.proxyEndpointConnectionToolConnectAction != null) { this.proxyEndpointConnectionToolConnectAction.Dispose(); this.proxyEndpointConnectionToolConnectAction = null; } } } finally { base.Dispose(disposing); } }
/// <summary> /// Dispose of connect actions. /// </summary> protected override void Dispose(bool disposing) { try { if(disposing) { if(this.hostApplicationCreateAction != null) { this.hostApplicationCreateAction.Dispose(); this.hostApplicationCreateAction = null; } if(this.serviceCreateAction != null) { this.serviceCreateAction.Dispose(); this.serviceCreateAction = null; } if(this.endpointCreateAction != null) { this.endpointCreateAction.Dispose(); this.endpointCreateAction = null; } if(this.clientApplicationCreateAction != null) { this.clientApplicationCreateAction.Dispose(); this.clientApplicationCreateAction = null; } if(this.proxyCreateAction != null) { this.proxyCreateAction.Dispose(); this.proxyCreateAction = null; } if(this.proxyEndpointConnectionToolConnectAction != null) { this.proxyEndpointConnectionToolConnectAction.Dispose(); this.proxyEndpointConnectionToolConnectAction = null; } } } finally { base.Dispose(disposing); } }
/// <summary> /// Override to provide the right mouse action when trying /// to create links on the diagram /// </summary> /// <param name="pointArgs"></param> public override void OnViewMouseEnter(DslDiagrams::DiagramPointEventArgs pointArgs) { if (pointArgs == null) { throw new global::System.ArgumentNullException("pointArgs"); } DslDiagrams::DiagramView activeView = this.ActiveDiagramView; if (activeView != null) { bool stickyMode = false; DslDesign::ModelingToolboxItem selectedToolboxItem = activeView.Toolbox.GetSelectedToolboxItem() as DslDesign::ModelingToolboxItem; if (selectedToolboxItem != null && selectedToolboxItem.Id == this.stickyToolboxItemId) { stickyMode = true; } else { stickyMode = false; this.stickyToolboxItemId = null; } DslDiagrams::MouseAction action = null; if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.HostApplicationFilterString)) { if (this.hostApplicationCreateAction == null) { this.hostApplicationCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.HostApplicationCreateAction(this); this.hostApplicationCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.hostApplicationCreateAction.StickyMode = stickyMode; action = this.hostApplicationCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ServiceFilterString)) { if (this.serviceCreateAction == null) { this.serviceCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ServiceCreateAction(this); this.serviceCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.serviceCreateAction.StickyMode = stickyMode; action = this.serviceCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.EndpointFilterString)) { if (this.endpointCreateAction == null) { this.endpointCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.EndpointCreateAction(this); this.endpointCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.endpointCreateAction.StickyMode = stickyMode; action = this.endpointCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ClientApplicationFilterString)) { if (this.clientApplicationCreateAction == null) { this.clientApplicationCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ClientApplicationCreateAction(this); this.clientApplicationCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.clientApplicationCreateAction.StickyMode = stickyMode; action = this.clientApplicationCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ProxyFilterString)) { if (this.proxyCreateAction == null) { this.proxyCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ProxyCreateAction(this); this.proxyCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.proxyCreateAction.StickyMode = stickyMode; action = this.proxyCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ProxyEndpointConnectionToolFilterString)) { if (this.proxyEndpointConnectionToolConnectAction == null) { this.proxyEndpointConnectionToolConnectAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ProxyEndpointConnectionToolConnectAction(this); this.proxyEndpointConnectionToolConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.proxyEndpointConnectionToolConnectAction.StickyMode = stickyMode; action = this.proxyEndpointConnectionToolConnectAction; } else { action = null; } if (pointArgs.DiagramClientView.ActiveMouseAction != action) { try { this.changingMouseAction = true; pointArgs.DiagramClientView.ActiveMouseAction = action; } finally { this.changingMouseAction = false; } } } }
/// <summary> /// Override to provide the right mouse action when trying /// to create links on the diagram /// </summary> /// <param name="pointArgs"></param> public override void OnViewMouseEnter(DslDiagrams::DiagramPointEventArgs pointArgs) { if (pointArgs == null) throw new global::System.ArgumentNullException("pointArgs"); DslDiagrams::DiagramView activeView = this.ActiveDiagramView; if(activeView != null) { bool stickyMode = false; DslDesign::ModelingToolboxItem selectedToolboxItem = activeView.Toolbox.GetSelectedToolboxItem() as DslDesign::ModelingToolboxItem; if (selectedToolboxItem != null && selectedToolboxItem.Id == this.stickyToolboxItemId) { stickyMode = true; } else { stickyMode = false; this.stickyToolboxItemId = null; } DslDiagrams::MouseAction action = null; if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.HostApplicationFilterString)) { if (this.hostApplicationCreateAction == null) { this.hostApplicationCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.HostApplicationCreateAction(this); this.hostApplicationCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.hostApplicationCreateAction.StickyMode = stickyMode; action = this.hostApplicationCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ServiceFilterString)) { if (this.serviceCreateAction == null) { this.serviceCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ServiceCreateAction(this); this.serviceCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.serviceCreateAction.StickyMode = stickyMode; action = this.serviceCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.EndpointFilterString)) { if (this.endpointCreateAction == null) { this.endpointCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.EndpointCreateAction(this); this.endpointCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.endpointCreateAction.StickyMode = stickyMode; action = this.endpointCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ClientApplicationFilterString)) { if (this.clientApplicationCreateAction == null) { this.clientApplicationCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ClientApplicationCreateAction(this); this.clientApplicationCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.clientApplicationCreateAction.StickyMode = stickyMode; action = this.clientApplicationCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ProxyFilterString)) { if (this.proxyCreateAction == null) { this.proxyCreateAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ProxyCreateAction(this); this.proxyCreateAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.proxyCreateAction.StickyMode = stickyMode; action = this.proxyCreateAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Microsoft.Practices.ServiceFactory.HostDesigner.HostDesignerToolboxHelper.ProxyEndpointConnectionToolFilterString)) { if (this.proxyEndpointConnectionToolConnectAction == null) { this.proxyEndpointConnectionToolConnectAction = new global::Microsoft.Practices.ServiceFactory.HostDesigner.ProxyEndpointConnectionToolConnectAction(this); this.proxyEndpointConnectionToolConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnToolboxActionDeactivated); } this.proxyEndpointConnectionToolConnectAction.StickyMode = stickyMode; action = this.proxyEndpointConnectionToolConnectAction; } else { action = null; } if (pointArgs.DiagramClientView.ActiveMouseAction != action) { try { this.changingMouseAction = true; pointArgs.DiagramClientView.ActiveMouseAction = action; } finally { this.changingMouseAction = false; } } } }