public bool isFileExists(MyFile file) { foreach (MyFile f in this.xmlfiles) { if (f.equals(file)) { return true; } } foreach (MyFile f in this.pdffiles) { if (f.equals(file)) { return true; } } foreach (MyFile f in this.workfiles) { if (f.equals(file)) { return true; } } return false; }
public bool equals(MyFile file) { return (this.filename == file.filename); }
private Folders getLocalFilesList() { this.form.addToLog("get local files list"); Folders result = new Folders(); string[] xmlFiles = Directory.GetFiles(this.settings.ResultsDataFolder); foreach (string fileName in xmlFiles) { MyFile f = new MyFile(fileName); result.Xmlfiles.Add(f); } string[] pdfFiles = Directory.GetFiles(this.settings.ResultsReportsFolder); foreach (string fileName in pdfFiles) { MyFile f = new MyFile(fileName); result.Pdffiles.Add(f); } string[] workFiles = Directory.GetFiles(this.settings.RequestsFolder); foreach (string fileName in workFiles) { MyFile f = new MyFile(fileName); result.Workfiles.Add(f); } return result; }