Ejemplo n.º 1
0
 public void Save(IStorageDevice storageDevice, string path)
 {
     using (var stream = storageDevice.Open(path, System.IO.FileMode.Create))
         using (var bw = new System.IO.BinaryWriter(stream, Encoding.UTF8, true))
         {
             RecursiveWriteStream(bw, _root);
         }
 }
Ejemplo n.º 2
0
        public static FileList FromRepositoryIndex(IStorageDevice storageDevice, string path)
        {
            path = System.IO.Path.GetFullPath(path);

            var fileList = new FileList();

            if (System.IO.File.Exists(path))
            {
                using (var stream = storageDevice.Open(path, System.IO.FileMode.Open))
                    using (var br = new System.IO.BinaryReader(stream, Encoding.UTF8, true))
                    {
                        RecursiveReadStream(br, fileList._root);
                    }
            }

            return(fileList);
        }