Beispiel #1
0
		/// <summary>
		/// Dispose of connect actions.
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			try
			{
				if(disposing)
				{
					if(this.unidirectionalAssociationConnectAction != null)
					{
						this.unidirectionalAssociationConnectAction.Dispose();
						this.unidirectionalAssociationConnectAction = null;
					}
					if(this.bidirectionalAssociationConnectAction != null)
					{
						this.bidirectionalAssociationConnectAction.Dispose();
						this.bidirectionalAssociationConnectAction = null;
					}
					if(this.aggregationConnectAction != null)
					{
						this.aggregationConnectAction.Dispose();
						this.aggregationConnectAction = null;
					}
					if(this.compositionConnectAction != null)
					{
						this.compositionConnectAction.Dispose();
						this.compositionConnectAction = null;
					}
					if(this.generalizationConnectAction != null)
					{
						this.generalizationConnectAction.Dispose();
						this.generalizationConnectAction = null;
					}
					if(this.multipleAssociationRoleConnectAction != null)
					{
						this.multipleAssociationRoleConnectAction.Dispose();
						this.multipleAssociationRoleConnectAction = null;
					}
					if(this.associationClassRelationshipConnectAction != null)
					{
						this.associationClassRelationshipConnectAction.Dispose();
						this.associationClassRelationshipConnectAction = null;
					}
					if(this.commentsReferenceTypesConnectAction != null)
					{
						this.commentsReferenceTypesConnectAction.Dispose();
						this.commentsReferenceTypesConnectAction = null;
					}
					this.UnsubscribeCompartmentItemsEvents();
				}
			}
			finally
			{
				base.Dispose(disposing);
			}
		}
Beispiel #2
0
		/// <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 (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.UnidirectionalAssociationFilterString))
				{
					if (this.unidirectionalAssociationConnectAction == null)
					{
						this.unidirectionalAssociationConnectAction = new global::pelsoft.FWK_Dsl.UnidirectionalAssociationConnectAction(this);
						this.unidirectionalAssociationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.unidirectionalAssociationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.BidirectionalAssociationFilterString))
				{
					if (this.bidirectionalAssociationConnectAction == null)
					{
						this.bidirectionalAssociationConnectAction = new global::pelsoft.FWK_Dsl.BidirectionalAssociationConnectAction(this);
						this.bidirectionalAssociationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.bidirectionalAssociationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.AggregationFilterString))
				{
					if (this.aggregationConnectAction == null)
					{
						this.aggregationConnectAction = new global::pelsoft.FWK_Dsl.AggregationConnectAction(this);
						this.aggregationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.aggregationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.CompositionFilterString))
				{
					if (this.compositionConnectAction == null)
					{
						this.compositionConnectAction = new global::pelsoft.FWK_Dsl.CompositionConnectAction(this);
						this.compositionConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.compositionConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.GeneralizationFilterString))
				{
					if (this.generalizationConnectAction == null)
					{
						this.generalizationConnectAction = new global::pelsoft.FWK_Dsl.GeneralizationConnectAction(this);
						this.generalizationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.generalizationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.MultipleAssociationRoleFilterString))
				{
					if (this.multipleAssociationRoleConnectAction == null)
					{
						this.multipleAssociationRoleConnectAction = new global::pelsoft.FWK_Dsl.MultipleAssociationRoleConnectAction(this);
						this.multipleAssociationRoleConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.multipleAssociationRoleConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.AssociationClassRelationshipFilterString))
				{
					if (this.associationClassRelationshipConnectAction == null)
					{
						this.associationClassRelationshipConnectAction = new global::pelsoft.FWK_Dsl.AssociationClassRelationshipConnectAction(this);
						this.associationClassRelationshipConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.associationClassRelationshipConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::pelsoft.FWK_Dsl.FWK_DslToolboxHelper.CommentsReferenceTypesFilterString))
				{
					if (this.commentsReferenceTypesConnectAction == null)
					{
						this.commentsReferenceTypesConnectAction = new global::pelsoft.FWK_Dsl.CommentsReferenceTypesConnectAction(this);
						this.commentsReferenceTypesConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.commentsReferenceTypesConnectAction;
				} 
				else
				{
					action = null;
				}
				
				if (pointArgs.DiagramClientView.ActiveMouseAction != action)
				{
					pointArgs.DiagramClientView.ActiveMouseAction = action;
				}
			}
		}