Пример #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
 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
 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;
        }