public void Run() { var files = new List <MatroskaFile>(); foreach (var dependency in _dependencies) { try { Process.Start(dependency); } catch (Win32Exception ex) { _ui.WriteError("Could not find " + dependency + " in path"); } } foreach (var file in Directory.GetFiles(_sourceDir)) { try { var matroskaFile = AnalyzeFile(file); files.Add(matroskaFile); } catch (MatroskaException ex) { _ui.WriteLine(" " + ex.Message); _ui.WriteLine(string.Empty); } } try { using (_dst = new StreamWriter(_dstFile)) { _ui.WriteLine("Created: " + _dstFile); _ui.WriteLine(string.Empty); for (var idx = 0; idx < files.Count; ++idx) { ProcessFile(files, idx); } } } catch (UnauthorizedAccessException ex) { _ui.WriteError("Could not write to " + _dstFile); } }