private void OpenDirectory(string path) { try { string pathBefor = _controller.CurrentDirectory; string newPath = _controller.AddDirectoryAndGetPath(path); string checkPath = newPath.Remove(newPath.Length - 1); if (System.IO.File.Exists(checkPath)) { var fileToOpen = checkPath; var process = new Process(); process.StartInfo = new ProcessStartInfo() { UseShellExecute = true, FileName = fileToOpen }; process.Start(); _controller.CurrentDirectory = pathBefor; } else { listView1.Items.Clear(); ShowDirectoriesInListView(Path.Combine(newPath)); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }