Beispiel #1
0
        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;
        }
Beispiel #3
0
        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 void WriteIndex(SealedDeckIndex index)
        {
            var formatter = CreateFormatter();

              using (var stream = new MemoryStream())
              {
            formatter.Serialize(stream, index);
            Folder.WriteFile(IndexFile, stream.ToArray());
              }
        }