private bool Open(string path) { //TODO: Find out if we can replace [result] with a returns bool result = false; if (File.Exists(path)) { FileNameEntered?.Invoke(this, EventArgs.Empty); result = true; } else if (Directory.Exists(path)) { if (ShellView != null) { Text = string.Empty; result = true; } } else { Text = Path.GetFileName(path); } if (!Path.IsPathRooted(path) && ShellView.CurrentFolder.IsFileSystem) { result = Open(Path.Combine(ShellView.CurrentFolder.FileSystemPath, path)); } return(result); }
private bool Open(string path) { var result = false; if (File.Exists(path)) { FileNameEntered?.Invoke(this, EventArgs.Empty); result = true; } else if (Directory.Exists(path)) { if (_mShellView != null) { _mShellView.Navigate(path); Text = string.Empty; result = true; } } else { OpenParentOf(path); Text = Path.GetFileName(path); } if (_mShellView != null && !Path.IsPathRooted(path) && _mShellView.CurrentFolder.IsFileSystem) { result = Open(Path.Combine(_mShellView.CurrentFolder.FileSystemPath, path)); } return(result); }
bool Open(string path) { //TODO: Someone clean this! bool result = false; if (File.Exists(path)) { FileNameEntered?.Invoke(this, EventArgs.Empty); result = true; } else if (Directory.Exists(path)) { if (ShellView != null) { Text = string.Empty; result = true; } } else { //OpenParentOf(path); Text = Path.GetFileName(path); } if (!Path.IsPathRooted(path) && ShellView.CurrentFolder.IsFileSystem) { result = Open(Path.Combine(ShellView.CurrentFolder.FileSystemPath, path)); } return(result); }