public TinkerGrapĥ(string directory, FileType fileType) { if (string.IsNullOrWhiteSpace(directory)) { throw new ArgumentNullException(nameof(directory)); } VertexKeyIndex = new TinkerKeyIndex(typeof(TinkerVertex), this); EdgeKeyIndex = new TinkerKeyIndex(typeof(TinkerEdge), this); _directory = directory; _fileType = fileType; if (!Directory.Exists(_directory)) { Directory.CreateDirectory(_directory); } else { var tinkerStorage = TinkerStorageFactory.GetInstance().GetTinkerStorage(fileType); var graph = tinkerStorage.Load(directory); InnerVertices = graph.InnerVertices; Edges = graph.Edges; CurrentId = graph.CurrentId; Indices = graph.Indices; VertexKeyIndex = graph.VertexKeyIndex; EdgeKeyIndex = graph.EdgeKeyIndex; } }
public TinkerGrapĥ() { VertexKeyIndex = new TinkerKeyIndex(typeof(TinkerVertex), this); EdgeKeyIndex = new TinkerKeyIndex(typeof(TinkerEdge), this); _directory = null; _fileType = FileType.DotNet; }
public void Clear() { InnerVertices.Clear(); Edges.Clear(); Indices.Clear(); CurrentId = 0; VertexKeyIndex = new TinkerKeyIndex(typeof(TinkerVertex), this); EdgeKeyIndex = new TinkerKeyIndex(typeof(TinkerEdge), this); }