Esempio n. 1
0
        private string[] BuildFriendlyAppNameList(string[] appPathList, string[] appEditionList, Dictionary <string, string> appPathToName, string defaultBuiltIn)
        {
            var list = new List <string>();

            for (int i = 0; i < appPathList.Length; ++i)
            {
                var appPath = appPathList[i];

                if (appPath == "internal" || appPath == "")     // use built-in
                {
                    list.Add(defaultBuiltIn);
                }
                else
                {
                    var friendlyName = StripMicrosoftFromVisualStudioName(OSUtil.GetAppFriendlyName(appPath));

                    if (appEditionList != null && !string.IsNullOrEmpty(appEditionList[i]))
                    {
                        friendlyName = string.Format("{0} ({1})", friendlyName, appEditionList[i]);
                    }
                    else if (appPathToName != null && appPathToName.ContainsKey(appPath))
                    {
                        friendlyName = appPathToName[appPath];
                    }

                    list.Add(friendlyName);
                }
            }

            return(list.ToArray());
        }
Esempio n. 2
0
        public static string GetCacheLocation()
        {
            var cachePath        = EditorPrefs.GetString(PathKey);
            var enableCustomPath = EditorPrefs.GetBool(CustomPathKey);
            var result           = cachePath;

            if (!enableCustomPath || string.IsNullOrEmpty(cachePath))
            {
                result = Paths.Combine(OSUtil.GetDefaultCachePath(), "CacheServer");
            }
            return(result);
        }
        public static string GetCacheLocation()
        {
            string str   = EditorPrefs.GetString("LocalCacheServerPath");
            bool   @bool = EditorPrefs.GetBool("LocalCacheServerCustomPath");
            string str2  = str;

            if (@bool && !string.IsNullOrEmpty(str))
            {
                return(str2);
            }
            string[] components = new string[] { OSUtil.GetDefaultCachePath(), "CacheServer" };
            return(Paths.Combine(components));
        }
Esempio n. 4
0
        public static string GetCacheLocation()
        {
            string @string = EditorPrefs.GetString("LocalCacheServerPath");
            bool   @bool   = EditorPrefs.GetBool("LocalCacheServerCustomPath");
            string result  = @string;

            if (!@bool || string.IsNullOrEmpty(@string))
            {
                result = Paths.Combine(new string[]
                {
                    OSUtil.GetDefaultCachePath(),
                    "CacheServer"
                });
            }
            return(result);
        }
Esempio n. 5
0
 public bool TryGetInstallationForPath(string editorPath, out CodeEditor.Installation installation)
 {
     if (string.IsNullOrEmpty(editorPath))
     {
         installation = new CodeEditor.Installation
         {
             Name = "",
             Path = ""
         };
         return(false);
     }
     installation = new CodeEditor.Installation
     {
         Name = OSUtil.GetAppFriendlyName(editorPath) + " (internal)",
         Path = editorPath
     };
     return(true);
 }
        private string[] BuildFriendlyAppNameList(string[] appPathList, string defaultBuiltIn)
        {
            List <string> list = new List <string>();

            for (int i = 0; i < appPathList.Length; i++)
            {
                string text = appPathList[i];
                if (text == string.Empty)
                {
                    list.Add(defaultBuiltIn);
                }
                else
                {
                    list.Add(OSUtil.GetAppFriendlyName(text));
                }
            }
            return(list.ToArray());
        }