예제 #1
0
 /// <summary />
 /// <remarks />
 public virtual bool ContainsGraph(GraphType _graph)
 {
     return this.List.Contains(_graph);
 }
예제 #2
0
 /// <summary />
 /// <remarks />
 public virtual void RemoveGraph(GraphType _graph)
 {
     this.List.Remove(_graph);
 }
예제 #3
0
 /// <summary />
 /// <remarks />
 public virtual void AddGraph(GraphType _graph)
 {
     this.List.Add(_graph);
 }
예제 #4
0
		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;
		}
예제 #5
0
 /// <summary />
 /// <remarks />
 public virtual void RemoveGraph(GraphType _graph)
 {
     this.List.Remove(_graph);
 }
예제 #6
0
 /// <summary />
 /// <remarks />
 public virtual bool ContainsGraph(GraphType _graph)
 {
     return(this.List.Contains(_graph));
 }
예제 #7
0
 /// <summary />
 /// <remarks />
 public virtual void AddGraph(GraphType _graph)
 {
     this.List.Add(_graph);
 }