/// <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) { DslDiagrams::MouseAction action = null; if (SelectedToolboxItemSupportsFilterString(activeView, global::AppDevUnited.TaskFlowDSLSample.TaskFlowDSLSampleToolboxHelper.FlowFilterString)) { if (this.flowConnectAction == null) { this.flowConnectAction = new global::AppDevUnited.TaskFlowDSLSample.FlowConnectAction(this); this.flowConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated); } action = this.flowConnectAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::AppDevUnited.TaskFlowDSLSample.TaskFlowDSLSampleToolboxHelper.CommentSubjectsFilterString)) { if (this.commentSubjectsConnectAction == null) { this.commentSubjectsConnectAction = new global::AppDevUnited.TaskFlowDSLSample.CommentSubjectsConnectAction(this); this.commentSubjectsConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated); } action = this.commentSubjectsConnectAction; } else { action = null; } if (pointArgs.DiagramClientView.ActiveMouseAction != action) { try { this.changingMouseAction = true; pointArgs.DiagramClientView.ActiveMouseAction = action; } finally { this.changingMouseAction = false; } } } }
/// <summary> /// Dispose of connect actions. /// </summary> protected override void Dispose(bool disposing) { try { if (disposing) { if (this.flowConnectAction != null) { this.flowConnectAction.Dispose(); this.flowConnectAction = null; } if (this.commentSubjectsConnectAction != null) { this.commentSubjectsConnectAction.Dispose(); this.commentSubjectsConnectAction = null; } } } finally { base.Dispose(disposing); } }