Beispiel #1
0
        /// <exception cref="ArgumentNullException">
        /// <paramref name="vertex"/> or <paramref name="entity"/> is null.
        /// </exception>
        public virtual EdgeRelationship AddEdgeRelationship(Vertex vertex, IEntity entity)
        {
            EdgeRelationship edgeRelationship = new EdgeRelationship(vertex, entity);

            AddEdgeRelationship(edgeRelationship);
            return(edgeRelationship);
        }
Beispiel #2
0
        public EdgeRelationship Clone(Vertex vertex, IEntity entity)
        {
            EdgeRelationship relationship = new EdgeRelationship(vertex, entity);

            relationship.CopyFrom(this);
            return(relationship);
        }
Beispiel #3
0
        protected virtual void AddEdgeRelationship(EdgeRelationship edgeRelationship)
        {
            AddRelationship(edgeRelationship);
            //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(edgeRelationship.FirstVertex.ID, edgeRelationship.SecondVertex.ID, edgeRelationship.Label);

            edgeLabel.Add(edgeID);
        }
Beispiel #4
0
 private void RemoveEdgeID(EdgeRelationship edgeRelationship)
 {
     //currently labels are empty.
     foreach (var item in edgeLabel)//don't need label to remove the edgeLabe.
     {
         if (item.ID1 == edgeRelationship.FirstVertex.ID && item.ID2 == edgeRelationship.SecondVertex.ID)
         {
             edgeLabel.Remove(item);
             break;
         }
     }
 }
Beispiel #5
0
 private void UpdateEdgeID(EdgeRelationship edgeRelationship)
 {
     foreach (EdgeID pair in edgeLabel)
     {
         if (pair.ID1 == edgeRelationship.FirstVertex.OldID && pair.ID2 == edgeRelationship.SecondVertex.OldID)// this is dangerous which requires updatae edgeID after refreshing vertex label.Will change later.
         {
             pair.ID1         = edgeRelationship.FirstVertex.ID;
             pair.ID2         = edgeRelationship.SecondVertex.ID;
             pair.LabelOfEdge = edgeRelationship.Label;
         }
     }
 }
Beispiel #6
0
        public bool InsertEdgeRelationship(EdgeRelationship edgeRelationship)
        {
            if (edgeRelationship != null && !relationships.Contains(edgeRelationship) &&
                entities.Contains(edgeRelationship.First) && entities.Contains(edgeRelationship.Second))
            {
                AddEdgeRelationship(edgeRelationship);

                return(true);
            }
            else
            {
                return(false);
            }
        }
 private void UpdateEdgeID(EdgeRelationship edgeRelationship)
 {
     foreach (EdgeID pair in edgeLabel)
     {
         if (pair.ID1 == edgeRelationship.FirstVertex.OldID && pair.ID2 == edgeRelationship.SecondVertex.OldID)// this is dangerous which requires updatae edgeID after refreshing vertex label.Will change later.
         {
             pair.ID1 = edgeRelationship.FirstVertex.ID;
             pair.ID2 = edgeRelationship.SecondVertex.ID;
             pair.LabelOfEdge = edgeRelationship.Label;
         }
     }
 }
 private void RemoveEdgeID(EdgeRelationship edgeRelationship)
 {
     //currently labels are empty.
     foreach(var item in edgeLabel)//don't need label to remove the edgeLabe.
     {
         if (item.ID1 == edgeRelationship.FirstVertex.ID && item.ID2 == edgeRelationship.SecondVertex.ID)
         {
             edgeLabel.Remove(item);
             break;
         }
     }
 }
 protected virtual void AddEdgeRelationship(EdgeRelationship edgeRelationship)
 {
     AddRelationship(edgeRelationship);
     //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(edgeRelationship.FirstVertex.ID, edgeRelationship.SecondVertex.ID, edgeRelationship.Label);
     edgeLabel.Add(edgeID);
 }
        public bool InsertEdgeRelationship(EdgeRelationship edgeRelationship)
        {
            if (edgeRelationship != null && !relationships.Contains(edgeRelationship) &&
                entities.Contains(edgeRelationship.First) && entities.Contains(edgeRelationship.Second))
            {
                AddEdgeRelationship(edgeRelationship);

                return true;

            }
            else
            {
                return false;
            }
        }
        /// <exception cref="ArgumentNullException">
        /// <paramref name="vertex"/> or <paramref name="entity"/> is null.
        /// </exception>
        public virtual EdgeRelationship AddEdgeRelationship(Vertex vertex, IEntity entity)
        {
            EdgeRelationship edgeRelationship = new EdgeRelationship(vertex, entity);

            AddEdgeRelationship(edgeRelationship);
            return edgeRelationship;
        }
 public EdgeRelationship Clone(Vertex vertex, IEntity entity)
 {
     EdgeRelationship relationship = new EdgeRelationship(vertex, entity);
     relationship.CopyFrom(this);
     return relationship;
 }