Esempio n. 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);
			}
		}
Esempio n. 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::LinqToRdf.Design.LinqToRdfToolboxHelper.UnidirectionalAssociationFilterString))
				{
					if (this.unidirectionalAssociationConnectAction == null)
					{
						this.unidirectionalAssociationConnectAction = new global::LinqToRdf.Design.UnidirectionalAssociationConnectAction(this);
						this.unidirectionalAssociationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.unidirectionalAssociationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::LinqToRdf.Design.LinqToRdfToolboxHelper.BidirectionalAssociationFilterString))
				{
					if (this.bidirectionalAssociationConnectAction == null)
					{
						this.bidirectionalAssociationConnectAction = new global::LinqToRdf.Design.BidirectionalAssociationConnectAction(this);
						this.bidirectionalAssociationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.bidirectionalAssociationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::LinqToRdf.Design.LinqToRdfToolboxHelper.AggregationFilterString))
				{
					if (this.aggregationConnectAction == null)
					{
						this.aggregationConnectAction = new global::LinqToRdf.Design.AggregationConnectAction(this);
						this.aggregationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.aggregationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::LinqToRdf.Design.LinqToRdfToolboxHelper.CompositionFilterString))
				{
					if (this.compositionConnectAction == null)
					{
						this.compositionConnectAction = new global::LinqToRdf.Design.CompositionConnectAction(this);
						this.compositionConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.compositionConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::LinqToRdf.Design.LinqToRdfToolboxHelper.GeneralizationFilterString))
				{
					if (this.generalizationConnectAction == null)
					{
						this.generalizationConnectAction = new global::LinqToRdf.Design.GeneralizationConnectAction(this);
						this.generalizationConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.generalizationConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::LinqToRdf.Design.LinqToRdfToolboxHelper.MultipleAssociationRoleFilterString))
				{
					if (this.multipleAssociationRoleConnectAction == null)
					{
						this.multipleAssociationRoleConnectAction = new global::LinqToRdf.Design.MultipleAssociationRoleConnectAction(this);
						this.multipleAssociationRoleConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.multipleAssociationRoleConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::LinqToRdf.Design.LinqToRdfToolboxHelper.AssociationClassRelationshipFilterString))
				{
					if (this.associationClassRelationshipConnectAction == null)
					{
						this.associationClassRelationshipConnectAction = new global::LinqToRdf.Design.AssociationClassRelationshipConnectAction(this);
						this.associationClassRelationshipConnectAction.MouseActionDeactivated += new DslDiagrams::MouseAction.MouseActionDeactivatedEventHandler(OnConnectActionDeactivated);
					}
					action = this.associationClassRelationshipConnectAction;
				} 
				else if (activeView.SelectedToolboxItemSupportsFilterString(global::LinqToRdf.Design.LinqToRdfToolboxHelper.CommentsReferenceTypesFilterString))
				{
					if (this.commentsReferenceTypesConnectAction == null)
					{
						this.commentsReferenceTypesConnectAction = new global::LinqToRdf.Design.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;
				}
			}
		}