public void Serialize(XmlWriter writer, GraphAbstract g ) { GraphMLType graphml = new GraphMLType(); graphml.Key.Add(BuildKeyType(nodeShapeTypeKeyName)); graphml.Key.Add(BuildKeyType(edgeConnectionTypeKeyName)); GraphType graph = new GraphType(); graphml.Items.Add(graph); foreach ( Shape s in g.Shapes ) { graph.Items.Add(SerializeNode(s)); } foreach(Connection c in g.Connections) { graph.Items.Add(SerializeEdge(c)); } foreach(DictionaryEntry de in KeyList) { graphml.Key.Add(BuildKeyType((String)de.Key)); } // serialize XmlSerializer ser = new XmlSerializer(typeof(GraphMLType)); ser.Serialize(writer,graphml); }
/// <summary /> /// <remarks /> public virtual void RemoveGraph(GraphType _graph) { this.List.Remove(_graph); }
/// <summary /> /// <remarks /> public virtual bool ContainsGraph(GraphType _graph) { return this.List.Contains(_graph); }
/// <summary /> /// <remarks /> public virtual void AddGraph(GraphType _graph) { this.List.Add(_graph); }