/// <summary /> /// <remarks /> public virtual bool ContainsGraph(GraphType _graph) { return this.List.Contains(_graph); }
/// <summary /> /// <remarks /> public virtual void RemoveGraph(GraphType _graph) { this.List.Remove(_graph); }
/// <summary /> /// <remarks /> public virtual void AddGraph(GraphType _graph) { this.List.Add(_graph); }
private GraphType SerializeGraph( ISerializableVertexAndEdgeListGraph baseGraph, IVertexAndEdgeListGraph g) { // create graph node GraphType graph = new GraphType(); // fill up graph if (g.IsDirected) graph.EdgeDefault = GraphEdgeDefaultType.Directed; else graph.EdgeDefault= GraphEdgeDefaultType.Undirected; // adding type information IGraphSerializationInfo info = new GraphSerializationInfo(true); info.Add(graphTypeKeyName,GetTypeQualifiedName(baseGraph)); info.Add(vertexProviderTypeKeyName,GetTypeQualifiedName(baseGraph.VertexProvider)); info.Add(edgeProviderTypeKeyName,GetTypeQualifiedName(baseGraph.EdgeProvider)); info.Add(allowParallelEdgesKeyName,g.AllowParallelEdges); // add data... foreach(DataType dt in ToDatas(info)) { graph.Items.AddData(dt); } // add vertices foreach(IVertex v in g.Vertices) graph.Items.AddNode( SerializeVertex(v) ); // add edges foreach(IEdge e in g.Edges) graph.Items.AddEdge( SerializeEdge(e) ); return graph; }
/// <summary /> /// <remarks /> public virtual bool ContainsGraph(GraphType _graph) { return(this.List.Contains(_graph)); }