예제 #1
0
파일: Model.cs 프로젝트: carlcnx/EnClass
        /// <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);
        }
예제 #2
0
        public AssociationRelationship Clone(TypeBase first, TypeBase second)
        {
            AssociationRelationship association = new AssociationRelationship(first, second);

            association.CopyFrom(this);
            return(association);
        }
예제 #3
0
파일: Model.cs 프로젝트: carlcnx/EnClass
        /// <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);
        }
예제 #4
0
파일: Model.cs 프로젝트: carlcnx/EnClass
        /// <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
        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;
        }
예제 #6
0
파일: Model.cs 프로젝트: carlcnx/EnClass
 public bool InsertAssociation(AssociationRelationship associaton)
 {
     if (associaton != null && !relationships.Contains(associaton) &&
         entities.Contains(associaton.First) && entities.Contains(associaton.Second))
     {
         AddAssociation(associaton);
         return(true);
     }
     else
     {
         return(false);
     }
 }
예제 #7
0
파일: Model.cs 프로젝트: carlcnx/EnClass
 protected virtual void AddAssociation(AssociationRelationship association)
 {
     AddRelationship(association);
 }