public override bool ConfigurationDialog() { var form = new SelectFilesForm(directory, "C# Source Files (*.cs)|*.cs"); var res = (DialogResult)taskInterface.Invoke(new Func <DialogResult>(() => form.ShowDialog(taskInterface))); if (res != DialogResult.OK) { return(false); } directory = form.GetDirectory(); foreach (var path in form.GetPaths()) { if (Directory.Exists(path)) { foreach (var file in Directory.GetFiles(path, "*.cs", SearchOption.AllDirectories)) { files.Add(file); } } else if (File.Exists(path) && path.EndsWith(".cs")) { files.Add(path); } } return(true); }
public override bool ConfigurationDialog() { var form = new SelectFilesForm(directory, "C# Source Files (*.cs)|*.cs"); var res = (DialogResult)taskInterface.Invoke(new Func<DialogResult>(() => form.ShowDialog(taskInterface))); if (res != DialogResult.OK) return false; directory = form.GetDirectory(); foreach (var path in form.GetPaths()) { if (Directory.Exists(path)) foreach (var file in Directory.GetFiles(path, "*.cs", SearchOption.AllDirectories)) files.Add(file); else if (File.Exists(path) && path.EndsWith(".cs")) files.Add(path); } return true; }