public static bool OpenFolderLocation(string folderPath) { try { if (!Directory.Exists(folderPath)) { return(false); } if (PlatformInfo.platform == Platforms.Windows) { Process.Start("explorer.exe", PlatformInfo.ConvertPathToPlatform(folderPath)); return(true); } else { throw new Exception("Unsuported platform: " + PlatformInfo.platform); } } catch (Exception ex) { DebugLog.LogError("Failed to open file: " + ex.Message); } return(false); }
public bool OpenFileLocation(string filePath) { try { string path = PlatformInfo.ConvertPathToPlatform(string.Format("{0}\\{1}", repository.repoPath, filePath)); if (!File.Exists(path)) { return(false); } if (PlatformInfo.platform == Platforms.Windows) { Process.Start("explorer.exe", "/select, " + path); return(true); } else { throw new Exception("Unsuported platform: " + PlatformInfo.platform); } } catch (Exception ex) { DebugLog.LogError("Failed to open folder location: " + ex.Message); } return(false); }