public PathRelationShip Clone(Vertex vertex, IEntity entity)
        {
            PathRelationShip relationship = new PathRelationShip(vertex, entity);

            relationship.CopyFrom(this);
            return(relationship);
        }
Ejemplo n.º 2
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="vertex"/> or <paramref name="entity"/> is null.
        /// </exception>
        public virtual PathRelationShip AddPathRelationShip(Vertex vertex, IEntity entity)
        {
            PathRelationShip path = new PathRelationShip(vertex, entity);

            AddPathRelationShip(path);
            return(path);
        }
Ejemplo n.º 3
0
        protected virtual void AddPathRelationShip(PathRelationShip path)
        {
            AddRelationship(path);
            //the following two is to add the edges to the array we want. it is put here because both the insert new and the load will go through this stage.
            EdgeID edgeID = new EdgeID(path.FirstVertex.ID, path.SecondVertex.ID, path.Label);

            pathLabel.Add(edgeID);
        }
Ejemplo n.º 4
0
 private void RemoveEdgeID(PathRelationShip path)
 {
     foreach (var item in pathLabel)//don't need label to remove the edgeLabe.
     {
         if (item.ID1 == path.FirstVertex.ID && item.ID2 == path.SecondVertex.ID)
         {
             pathLabel.Remove(item);
             break;
         }
     }
 }
Ejemplo n.º 5
0
 private void UpdatePathID(PathRelationShip path)
 {
     foreach (EdgeID pair in pathLabel)
     {
         if (pair.ID1 == path.FirstVertex.OldID && pair.ID2 == path.SecondVertex.OldID)// this is dangerous which requires updatae edgeID after refreshing vertex label.Will change later.
         {
             pair.ID1         = path.FirstVertex.ID;
             pair.ID2         = path.SecondVertex.ID;
             pair.LabelOfEdge = path.Label;
         }
     }
 }
Ejemplo n.º 6
0
        public bool InsertPathRelationShip(PathRelationShip path)
        {
            if (path != null && !relationships.Contains(path) &&
                entities.Contains(path.First) && entities.Contains(path.Second))
            {
                AddPathRelationShip(path);

                return(true);
            }
            else
            {
                return(false);
            }
        }
 private void UpdatePathID(PathRelationShip path)
 {
     foreach (EdgeID pair in pathLabel)
     {
         if (pair.ID1 == path.FirstVertex.OldID && pair.ID2 == path.SecondVertex.OldID)// this is dangerous which requires updatae edgeID after refreshing vertex label.Will change later.
         {
             pair.ID1 = path.FirstVertex.ID;
             pair.ID2 = path.SecondVertex.ID;
             pair.LabelOfEdge = path.Label;
         }
     }
 }
 private void RemoveEdgeID(PathRelationShip path)
 {
     foreach (var item in pathLabel)//don't need label to remove the edgeLabe.
     {
         if (item.ID1 == path.FirstVertex.ID && item.ID2 == path.SecondVertex.ID)
         {
             pathLabel.Remove(item);
             break;
         }
     }
 }
 protected virtual void AddPathRelationShip(PathRelationShip path)
 {
     AddRelationship(path);
     //the following two is to add the edges to the array we want. it is put here because both the insert new and the load will go through this stage.
     EdgeID edgeID = new EdgeID(path.FirstVertex.ID, path.SecondVertex.ID, path.Label);
     pathLabel.Add(edgeID);
 }
Ejemplo n.º 10
0
        public bool InsertPathRelationShip(PathRelationShip path)
        {
            if (path != null && !relationships.Contains(path) &&
                entities.Contains(path.First) && entities.Contains(path.Second))
            {
                AddPathRelationShip(path);

                return true;

            }
            else
            {
                return false;
            }
        }
Ejemplo n.º 11
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="vertex"/> or <paramref name="entity"/> is null.
        /// </exception>
        public virtual PathRelationShip AddPathRelationShip(Vertex vertex, IEntity entity)
        {
            PathRelationShip path = new PathRelationShip(vertex, entity);

            AddPathRelationShip(path);
            return path;
        }
 public PathRelationShip Clone(Vertex vertex, IEntity entity)
 {
     PathRelationShip relationship = new PathRelationShip(vertex, entity);
     relationship.CopyFrom(this);
     return relationship;
 }