/// <summary> /// Dispose of connect actions. /// </summary> protected override void Dispose(bool disposing) { try { if (disposing) { if (this.parentLinkConnectAction != null) { this.parentLinkConnectAction.Dispose(); this.parentLinkConnectAction = null; } if (this.residenceConnectionConnectAction != null) { this.residenceConnectionConnectAction.Dispose(); this.residenceConnectionConnectAction = null; } if (this.nationalityConnectorConnectAction != null) { this.nationalityConnectorConnectAction.Dispose(); this.nationalityConnectorConnectAction = 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) { DslDiagrams::MouseAction action = null; if (SelectedToolboxItemSupportsFilterString(activeView, global::Company.FamilyTree.FamilyTreeToolboxHelper.ParentLinkFilterString)) { if (this.parentLinkConnectAction == null) { this.parentLinkConnectAction = new global::Company.FamilyTree.ParentLinkConnectAction(this); this.parentLinkConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated); } action = this.parentLinkConnectAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Company.FamilyTree.FamilyTreeToolboxHelper.ResidenceConnectionFilterString)) { if (this.residenceConnectionConnectAction == null) { this.residenceConnectionConnectAction = new global::Company.FamilyTree.ResidenceConnectionConnectAction(this); this.residenceConnectionConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated); } action = this.residenceConnectionConnectAction; } else if (SelectedToolboxItemSupportsFilterString(activeView, global::Company.FamilyTree.FamilyTreeToolboxHelper.NationalityConnectorFilterString)) { if (this.nationalityConnectorConnectAction == null) { this.nationalityConnectorConnectAction = new global::Company.FamilyTree.NationalityConnectorConnectAction(this); this.nationalityConnectorConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated); } action = this.nationalityConnectorConnectAction; } else { action = null; } if (pointArgs.DiagramClientView.ActiveMouseAction != action) { try { this.changingMouseAction = true; pointArgs.DiagramClientView.ActiveMouseAction = action; } finally { this.changingMouseAction = false; } } } }