public static FileHashDatabase Load(FileInfo file) { FileHashDatabase result = new FileHashDatabase(); FileStream stream = null; try { stream = file.OpenRead(); result.m_files = stream.Deserialize<Dictionary<string, HashStamp>>(); } catch (Exception) { result.m_files = new Dictionary<string, HashStamp>(); } finally { if (stream != null) stream.Close(); } result.m_root = new Uri(file.Directory.FullName + "/"); return result; }
private void BeginScan() { Log("Checking local installation"); m_cache = FileHashDatabase.Load(CacheFile); DirectoryScanner.ScanCompleteCallback callback = (x, y) => Dispatcher.BeginInvoke(new DirectoryScanner.ScanCompleteCallback(DirectoryScanComplete), DispatcherPriority.Normal, new object[] { x, y }); m_scanner.BeginScan(m_installPath_DayZRP, callback); }