예제 #1
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="first"/> or <paramref name="second"/> is null.
        /// </exception>
        public DependencyRelationship AddDependency(TypeBase first, TypeBase second)
        {
            DependencyRelationship dependency = new DependencyRelationship(first, second);

            AddRelationship(dependency);
            return(dependency);
        }
예제 #2
0
파일: Dependency.cs 프로젝트: koenmd/nERD
 protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second)
 {
     if (first.Entity is TypeBase firstType && second.Entity is TypeBase secondType)
     {
         DependencyRelationship clone = DependencyRelationship.Clone(firstType, secondType);
         return(diagram.InsertDependency(clone));
     }
예제 #3
0
        private DependencyRelationship AddDependency(DependencyRelationship dependency)
        {
            Shape startShape = GetShape(dependency.First);
            Shape endShape   = GetShape(dependency.Second);

            AddConnection(new Dependency(dependency, startShape, endShape));
            return(dependency);
        }
예제 #4
0
        public bool InsertDependency(DependencyRelationship dependency)
        {
            if (dependency != null && !model.Relationships.Contains(dependency) &&
                model.Entities.Contains(dependency.First) && model.Entities.Contains(dependency.Second))
            {
                AddDependency(dependency);
                return(true);
            }

            return(false);
        }
예제 #5
0
        protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second)
        {
            var firstType  = first.Entity as TypeBase;
            var secondType = second.Entity as TypeBase;

            if (firstType != null && secondType != null)
            {
                var clone = DependencyRelationship.Clone(firstType, secondType);
                return(diagram.InsertDependency(clone));
            }
            return(false);
        }
예제 #6
0
        protected override bool CloneRelationship(IDiagram diagram, Shape first, Shape second)
        {
            if (diagram.DiagramType != DiagramType.ClassDiagram)
            {
                return(false);
            }

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

            if (firstType != null && secondType != null)
            {
                DependencyRelationship clone = dependency.Clone(firstType, secondType);
                return(((ClassDiagram)diagram).InsertDependency(clone));
            }
            else
            {
                return(false);
            }
        }
예제 #7
0
        private static void NewNode()
        {
            // new SDI
            var sdi = Node.NewNode <SDI>(_mediator, null, "Final try",
                                         new Tuple <string, object>("DataCode", "ewrew"),
                                         new Tuple <string, object>("Section", "3333"));

            sdi.Save();

            var comodity = Node.NewNode <Commodity>(_mediator, "Onthefly", "this is a commodity");

            comodity.Save();

            var co = Node.NewNode <ControlObject>(_mediator, "=122453/2132", "ssss");

            co.Save();

            var rel = new DependencyRelationship();

            rel.SetNodes(co, comodity);
            rel.Save();
        }
예제 #8
0
파일: Dependency.cs 프로젝트: koenmd/nERD
 public Dependency(DependencyRelationship dependency, Shape startShape, Shape endShape) :
     base(dependency, startShape, endShape)
 {
     DependencyRelationship = dependency;
 }
예제 #9
0
 public bool InsertDependency(DependencyRelationship dependency)
 {
     return(model.InsertRelationship(dependency));
 }
예제 #10
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="first"/> or <paramref name="second"/> is null.
        /// </exception>
        public DependencyRelationship AddDependency(TypeBase first, TypeBase second)
        {
            DependencyRelationship dependency = new DependencyRelationship(first, second);

            AddRelationship(dependency);
            return dependency;
        }