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

            relationship.CopyFrom(this);
            return(relationship);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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;
         }
     }
 }
예제 #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;
         }
     }
 }
예제 #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);
 }
        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;
            }
        }
        /// <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;
 }