Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }