private static void WriteIndex(SealedDeckIndex index) { var formatter = CreateFormatter(); using (var stream = new MemoryStream()) { formatter.Serialize(stream, index); Folder.WriteFile(IndexFile, stream.ToArray()); } }
private static SealedDeckIndex BuildIndex() { var index = new SealedDeckIndex(); foreach (var resource in Folder.ReadAll()) { if (!resource.Name.EndsWith(".dec")) continue; var deck = DeckFile.Read(resource.Name, resource.Content); index.Entries[resource.Name] = deck.LimitedCode.GetValueOrDefault(); } WriteIndex(index); return index; }
private static SealedDeckIndex BuildIndex() { var index = new SealedDeckIndex(); foreach (var resource in Folder.ReadAll()) { if (!resource.Name.EndsWith(".dec")) { continue; } var deck = DeckFile.Read(resource.Name, resource.Content); index.Entries[resource.Name] = deck.LimitedCode.GetValueOrDefault(); } WriteIndex(index); return(index); }