public override void GetStatus(out folderState state, out List <string> files) { state = folderState.finished; string[] temp = new string[1]; List <string> unfList = new List <string>(); try { temp = GetDirectoryFromDrives(); //test none state if (temp.Length == 0) //check if null then { state = folderState.none; } //test for unfinished state int countNonUnf = 0; for (int i = 0; i < temp.Length; i++) { string temp2 = Path.GetFileName(temp[i]); if (temp2.Contains(unfinishedTag)) { File.Delete(temp[i]); } else { countNonUnf++; } } if (countNonUnf > 0) { state = folderState.finished; temp = GetDirectoryFromDrives(); } } catch (Exception e) { logger.log(echo + e); logger.stopLogging(); Environment.Exit(1); } if (state == folderState.finished) { unfList = getLastestFile(temp); } files = unfList; }
private void init(folderState state) { isProgramRunning = true; nrOfGroupedHashes = 6000000; this.state = state; isDone = new bool[Environment.ProcessorCount]; workers = new Thread[Environment.ProcessorCount]; saver = new IDataSaver[Environment.ProcessorCount]; if (state == folderState.none || state == folderState.finished) { for (int i = 0; i < Environment.ProcessorCount; i++) { isDone[i] = true; } } currentDriveGiven = 0; }
public abstract void GetStatus(out folderState state, out List <string> files);