コード例 #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);
        }
コード例 #2
0
ファイル: ClassModel.cs プロジェクト: vCipher/NClass
        /// <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);
        }
コード例 #3
0
ファイル: Nesting.cs プロジェクト: koenmd/nERD
 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));
     }
コード例 #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);
        }
コード例 #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);
        }
コード例 #6
0
ファイル: Nesting.cs プロジェクト: immeraufdemhund/NClass
        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);
        }
コード例 #7
0
ファイル: Nesting.cs プロジェクト: vCipher/NClass
        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);
            }
        }
コード例 #8
0
ファイル: Nesting.cs プロジェクト: vCipher/NClass
 /// <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;
 }
コード例 #9
0
 public bool InsertNesting(NestingRelationship nesting)
 {
     return(model.InsertRelationship(nesting));
 }
コード例 #10
0
ファイル: ClassModel.cs プロジェクト: gbaychev/NClass
        /// <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;
        }