private void InitIndexSink(FileHashDB sender) { OnIndexRebuilt -= new OnIndexRebuiltHandler(InitIndexSink); if (OnReady != null) { OnReady(this, null); } }
private void WriteInitSink(IAsyncResult result) { fstream.EndWrite(result); IndexFilePath = DBFileInfo.FullName.Substring(0, DBFileInfo.FullName.Length - DBFileInfo.Extension.Length) + ".idx"; if (File.Exists(IndexFilePath)) { InitThread = new Thread(new ThreadStart(InitThreadEntry)); InitThread.Start(); } else { OnIndexRebuilt += new OnIndexRebuiltHandler(InitIndexSink); RebuildIndex(); } }
private void InitThreadEntry() { FileStream istream = new FileStream(IndexFilePath, FileMode.Open); BinaryFormatter bf = new BinaryFormatter(); IndexStruct iss = (IndexStruct)bf.Deserialize(istream); istream.Close(); Map = iss.IndexHashTable; if (iss.UpdateID == UpdateID) { if (OnReady != null) { OnReady(this, null); } } else { Map.Clear(); OnIndexRebuilt += new OnIndexRebuiltHandler(InitIndexSink); RebuildIndex(); } }
private void WriteInitSink(IAsyncResult result) { fstream.EndWrite(result); IndexFilePath = DBFileInfo.FullName.Substring(0,DBFileInfo.FullName.Length-DBFileInfo.Extension.Length) + ".idx"; if(File.Exists(IndexFilePath)) { InitThread = new Thread(new ThreadStart(InitThreadEntry)); InitThread.Start(); } else { OnIndexRebuilt += new OnIndexRebuiltHandler(InitIndexSink); RebuildIndex(); } }
private void InitThreadEntry() { FileStream istream = new FileStream(IndexFilePath,FileMode.Open); BinaryFormatter bf = new BinaryFormatter(); IndexStruct iss = (IndexStruct)bf.Deserialize(istream); istream.Close(); Map = iss.IndexHashTable; if(iss.UpdateID==UpdateID) { if(OnReady!=null) OnReady(this,null); } else { Map.Clear(); OnIndexRebuilt += new OnIndexRebuiltHandler(InitIndexSink); RebuildIndex(); } }
private void InitIndexSink(FileHashDB sender) { OnIndexRebuilt -= new OnIndexRebuiltHandler(InitIndexSink); if(OnReady!=null) OnReady(this, null); }