Exemple #1
0
 public void RemoveRelationship(Relationship relationship)
 {
     if (relationships.Contains(relationship))
     {
         if (relationship.RelationshipType == RelationshipType.Edge)
         {
             //remove the corresponding edgeID list element.
             RemoveEdgeID((EdgeRelationship)relationship);
         }
         if (relationship.RelationshipType == RelationshipType.Path)
         {
             RemoveEdgeID((PathRelationShip)relationship);
         }
         relationship.Detach();
         relationship.Modified -= new EventHandler(ElementChanged);
         relationships.Remove(relationship);
         OnRelationRemoved(new RelationshipEventArgs(relationship));
     }
 }
Exemple #2
0
 //add the function to it to remove from edgeID.
 private void RemoveRelationships(IEntity entity)
 {
     for (int i = 0; i < relationships.Count; i++)
     {
         Relationship relationship = relationships[i];
         if (relationship.First == entity || relationship.Second == entity)
         {
             if (relationship.RelationshipType == RelationshipType.Edge)//if it's the vertex type.
             {
                 //remove the corresponding edgeID related to the entity.
                 RemoveEdgeID((EdgeRelationship)relationship);
             }
             if (relationship.RelationshipType == RelationshipType.Path)
             {
                 RemoveEdgeID((PathRelationShip)relationship);
             }
             relationship.Detach();
             relationship.Modified -= new EventHandler(ElementChanged);
             relationships.RemoveAt(i--);
             OnRelationRemoved(new RelationshipEventArgs(relationship));
         }
     }
 }
        public void RemoveRelationship(Relationship relationship)
        {
            if (relationships.Contains(relationship))
            {

                if (relationship.RelationshipType == RelationshipType.Edge)
                {
                    //remove the corresponding edgeID list element.
                    RemoveEdgeID((EdgeRelationship)relationship);
                }
                if (relationship.RelationshipType == RelationshipType.Path)
                {
                    RemoveEdgeID((PathRelationShip)relationship);
                }
                relationship.Detach();
                relationship.Modified -= new EventHandler(ElementChanged);
                relationships.Remove(relationship);
                OnRelationRemoved(new RelationshipEventArgs(relationship));
            }
        }