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()); }
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()); }