예제 #1
0
 // convenience helper function for firing the changing node/edge/object attribute event (for an attribute of map type, contains type dispatching and fixes the change type to element addition)
 public static void ChangingMapAttributePutElement(IGraph graph, IAttributeBearer owner, AttributeType attrType, object key, object value)
 {
     if (owner is INode)
     {
         graph.ChangingNodeAttribute((INode)owner, attrType, AttributeChangeType.PutElement, value, key);
     }
     else if (owner is IEdge)
     {
         graph.ChangingEdgeAttribute((IEdge)owner, attrType, AttributeChangeType.PutElement, value, key);
     }
     else
     {
         graph.ChangingObjectAttribute((IObject)owner, attrType, AttributeChangeType.PutElement, value, key);
     }
 }
예제 #2
0
 // convenience helper function for firing the changing node/edge/object attribute event (for an attribute of map type, contains type dispatching and fixes the change type to element removal)
 public static void ChangingMapAttributeRemoveElement(IGraph graph, IAttributeBearer owner, AttributeType attrType, object keyToRemove)
 {
     if (owner is INode)
     {
         graph.ChangingNodeAttribute((INode)owner, attrType, AttributeChangeType.RemoveElement, null, keyToRemove);
     }
     else if (owner is IEdge)
     {
         graph.ChangingEdgeAttribute((IEdge)owner, attrType, AttributeChangeType.RemoveElement, null, keyToRemove);
     }
     else
     {
         graph.ChangingObjectAttribute((IObject)owner, attrType, AttributeChangeType.RemoveElement, null, keyToRemove);
     }
 }
예제 #3
0
 // convenience helper function for firing the changing node/edge/object attribute event (contains type dispatching and fixes the change type to assignment)
 public static void ChangingAttributeAssign(IGraph graph, IAttributeBearer owner, AttributeType attrType, object value)
 {
     if (owner is INode)
     {
         graph.ChangingNodeAttribute((INode)owner, attrType, AttributeChangeType.Assign, value, null);
     }
     else if (owner is IEdge)
     {
         graph.ChangingEdgeAttribute((IEdge)owner, attrType, AttributeChangeType.Assign, value, null);
     }
     else
     {
         graph.ChangingObjectAttribute((IObject)owner, attrType, AttributeChangeType.Assign, value, null);
     }
 }