Пример #1
0
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="first" /> or <paramref name="second" /> is null.
        /// </exception>
        public AssociationRelationship AddAggregation(TypeBase first, TypeBase second)
        {
            AssociationRelationship aggregation = new AssociationRelationship(first, second, AssociationType.Aggregation);

            AddAssociation(aggregation);
            return(aggregation);
        }
Пример #2
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="first"/> or <paramref name="second"/> is null.
        /// </exception>
        public AssociationRelationship AddAssociation(TypeBase first, TypeBase second)
        {
            AssociationRelationship association = new AssociationRelationship(first, second);

            AddAssociation(association);
            return(association);
        }
Пример #3
0
        public AssociationRelationship Clone(TypeBase first, TypeBase second)
        {
            AssociationRelationship association = new AssociationRelationship(first, second);

            association.CopyFrom(this);
            return(association);
        }
Пример #4
0
        /// <exception cref="ArgumentNullException">
        ///     <paramref name="first" /> or <paramref name="second" /> is null.
        /// </exception>
        public AssociationRelationship AddComposition(TypeBase first, TypeBase second)
        {
            AssociationRelationship composition = new AssociationRelationship(first, second, AssociationType.Composition);

            AddAssociation(composition);
            return(composition);
        }
Пример #5
0
 public bool InsertAssociation(AssociationRelationship associaton)
 {
     if ((associaton != null) && !relationships.Contains(associaton) && entities.Contains(associaton.First) && entities.Contains(associaton.Second))
     {
         AddAssociation(associaton);
         return(true);
     }
     return(false);
 }
Пример #6
0
        protected override void CopyFrom(Relationship relationship)
        {
            base.CopyFrom(relationship);

            AssociationRelationship association = (AssociationRelationship)relationship;

            associationType   = association.associationType;
            direction         = association.direction;
            startRole         = association.startRole;
            endRole           = association.endRole;
            startMultiplicity = association.startMultiplicity;
            endMultiplicity   = association.endMultiplicity;
        }
Пример #7
0
        protected override void CopyFrom(Relationship relationship)
        {
            base.CopyFrom(relationship);

            AssociationRelationship association = (AssociationRelationship)relationship;

            _associationType   = association._associationType;
            _direction         = association._direction;
            _startRole         = association._startRole;
            _endRole           = association._endRole;
            _startMultiplicity = association._startMultiplicity;
            _endMultiplicity   = association._endMultiplicity;
        }
Пример #8
0
 protected virtual void AddAssociation(AssociationRelationship association)
 {
     AddRelationship(association);
 }
Пример #9
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="association"/> is null.-or-
		/// <paramref name="startShape"/> is null.-or-
		/// <paramref name="endShape"/> is null.
		/// </exception>
		public Association(AssociationRelationship association, Shape startShape, Shape endShape)
			: base(association, startShape, endShape)
		{
			this.association = association;
			association.Reversed += new EventHandler(association_Reversed);
		}
Пример #10
0
		public AssociationRelationship Clone(TypeBase first, TypeBase second)
		{
			AssociationRelationship association = new AssociationRelationship(first, second);
			association.CopyFrom(this);
			return association;
		}