Beispiel #1
0
        internal IList <T> Load(IEnumerable <Index> indexes)
        {
            IList <T> results = new List <T>(indexes.Count());
            IDictionary <int, int> positions = new Dictionary <int, int>();

            foreach (var i in indexes)
            {
                positions.Add(i.Position, i.Length);
            }

            foreach (var doc in FileManager.Read(positions))
            {
                results.Add(Json.Deserialize <T>(doc));
            }

            return(results);
        }
Beispiel #2
0
 private void LoadBlocks()
 {
     if (isf.FileExists(BlocksFile))
     {
         using (var read = new StreamReader(new IsolatedStorageFileStream(BlocksFile, FileMode.Open, FileAccess.Read, isf)))
         {
             Blocks = Json.Deserialize <IDictionary <int, bool> >(read.ReadLine());
             read.Close();
         }
     }
 }
Beispiel #3
0
        private void LoadIndex()
        {
            Indexes = new List <Index>();
            IndexProperties <T> indexProp = new IndexProperties <T>();

            if (isoStore.FileExists(filename))
            {
                StreamReader readFile
                    = new StreamReader(new IsolatedStorageFileStream(filename, FileMode.Open, FileAccess.Read, isoStore));

                Indexes = Json.Deserialize <List <Index> >(readFile.ReadLine());
                readFile.Close();
            }
        }