コード例 #1
0
		private IGraphSerializationInfo InfoFromEdge(EdgeType edge)
		{
			GraphSerializationInfo info = new GraphSerializationInfo(false);

			foreach(DataType dt in edge.Data)
			{
				info.Add(dt.Key, dt.Text);
			}

			return info;
		}
コード例 #2
0
		private EdgeType SerializeEdge(IEdge e)
		{
			EdgeType edge = new EdgeType();
			edge.ID = FormatID(e);
			edge.Source = FormatID(e.Source);
			edge.Target = FormatID(e.Target);
			edge.Directed = true;

			GraphSerializationInfo info = new GraphSerializationInfo(true);
			((IGraphSerializable)e).WriteGraphData(info);

			foreach(DataType dt in ToDatas(info))
			{
				edge.Data.AddDataType(dt);
			}

			return edge;
		}
コード例 #3
0
 /// <summary />
 /// <remarks />
 public virtual bool ContainsEdge(EdgeType _edge)
 {
     return this.List.Contains(_edge);
 }
コード例 #4
0
 /// <summary />
 /// <remarks />
 public virtual void RemoveEdge(EdgeType _edge)
 {
     this.List.Remove(_edge);
 }
コード例 #5
0
 /// <summary />
 /// <remarks />
 public virtual void AddEdge(EdgeType _edge)
 {
     this.List.Add(_edge);
 }