private IGraphSerializationInfo InfoFromEdge(EdgeType edge) { GraphSerializationInfo info = new GraphSerializationInfo(false); foreach(DataType dt in edge.Data) { info.Add(dt.Key, dt.Text); } return info; }
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; }
/// <summary /> /// <remarks /> public virtual bool ContainsEdge(EdgeType _edge) { return this.List.Contains(_edge); }
/// <summary /> /// <remarks /> public virtual void RemoveEdge(EdgeType _edge) { this.List.Remove(_edge); }
/// <summary /> /// <remarks /> public virtual void AddEdge(EdgeType _edge) { this.List.Add(_edge); }