Ejemplo n.º 1
0
        /// <exception cref="RelationshipException">
        /// Cannot create relationship between the two types.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="parentType"/> or <paramref name="innerType"/> is null.
        /// </exception>
        public NestingRelationship AddNesting(INestable parentType, INestableChild innerType)
        {
            NestingRelationship nesting = new NestingRelationship(parentType, innerType);

            AddRelationship(nesting);
            return(nesting);
        }
Ejemplo n.º 2
0
        /// <exception cref="RelationshipException">
        /// Cannot create relationship between the two types.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="parentType"/> or <paramref name="innerType"/> is null.
        /// </exception>
        public NestingRelationship AddNesting(CompositeType parentType, TypeBase innerType)
        {
            NestingRelationship nesting = new NestingRelationship(parentType, innerType);

            AddRelationship(nesting);
            return(nesting);
        }
Ejemplo n.º 3
0
 protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second)
 {
     if (first.Entity is CompositeType firstType && second.Entity is TypeBase secondType)
     {
         NestingRelationship clone = NestingRelationship.Clone(firstType, secondType);
         return(diagram.InsertNesting(clone));
     }
Ejemplo n.º 4
0
        public NestingRelationship AddNesting(NestingRelationship nesting)
        {
            Shape startShape = GetShape(nesting.First);
            Shape endShape   = GetShape(nesting.Second);

            AddConnection(new Nesting(nesting, startShape, endShape));
            return(nesting);
        }
Ejemplo n.º 5
0
        public bool InsertNesting(NestingRelationship nesting)
        {
            if (nesting != null && !model.Relationships.Contains(nesting) &&
                model.Entities.Contains(nesting.First) && model.Entities.Contains(nesting.Second))
            {
                AddNesting(nesting);
                return(true);
            }

            return(false);
        }
Ejemplo n.º 6
0
        protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second)
        {
            var firstType  = first.Entity as CompositeType;
            var secondType = second.Entity as TypeBase;

            if (firstType != null && secondType != null)
            {
                var clone = NestingRelationship.Clone(firstType, secondType);
                return(diagram.InsertNesting(clone));
            }
            return(false);
        }
Ejemplo n.º 7
0
        protected override bool CloneRelationship(IDiagram diagram, Shape first, Shape second)
        {
            if (diagram.DiagramType != DiagramType.ClassDiagram)
            {
                return(false);
            }

            CompositeType firstType  = first.Entity as CompositeType;
            TypeBase      secondType = second.Entity as TypeBase;

            if (firstType != null && secondType != null)
            {
                NestingRelationship clone = nesting.Clone(firstType, secondType);
                return(((ClassDiagram)diagram).InsertNesting(clone));
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 8
0
 /// <exception cref="ArgumentNullException">
 /// <paramref name="nesting"/> is null.-or-
 /// <paramref name="startShape"/> is null.-or-
 /// <paramref name="endShape"/> is null.
 /// </exception>
 public Nesting(NestingRelationship nesting, Shape startShape, Shape endShape)
     : base(nesting, startShape, endShape)
 {
     this.nesting = nesting;
 }
Ejemplo n.º 9
0
 public bool InsertNesting(NestingRelationship nesting)
 {
     return(model.InsertRelationship(nesting));
 }
Ejemplo n.º 10
0
        /// <exception cref="RelationshipException">
        /// Cannot create relationship between the two types.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="parentType"/> or <paramref name="innerType"/> is null.
        /// </exception>
        public NestingRelationship AddNesting(CompositeType parentType, TypeBase innerType)
        {
            NestingRelationship nesting = new NestingRelationship(parentType, innerType);

            AddRelationship(nesting);
            return nesting;
        }