Example #1
0
 public Attributed(Attributed a)
 {
     string val;
     foreach (string key in a._attribs.Keys)
     {
         if (!_attribs.TryGetValue(key, out val))
         {
             throw new Exception("shouldn't get here if single-threaded");
         }
         _attribs.Add(key, val);
     }
 }
 public void addVertex(string containingKey, string thisKey)
 {
     Attributed val = new Attributed("label", thisKey);
     _builder.add(containingKey, thisKey, val, false);
 }
 public void addSubgraph(string containingKey, string thisKey)
 {
     Attributed val = new Attributed("label", thisKey);
     _builder.add(containingKey, thisKey, val, true);
 }
 public void clearAttribs()
 {
     _mainGraphAttribs = new Attributed();
     _subgraphAttribs = new Attributed();
     _mainGraphNodeAttribs = new Attributed();
     _subgraphNodeAttribs = new Attributed();
 }
Example #5
0
 // append entries from src into this
 // on matching keys, overwrite with values from src
 public void graft(Attributed src)
 {
     foreach (KeyValuePair<string, string> kvp in src.attribs)
     {
         if (hasKey(kvp.Key))
             attribs[kvp.Key] = kvp.Value;
         else
             attribs.Add(kvp.Key, kvp.Value);
     }
 }