public static void CopyVSKToIDEDir(string fileToCopy) { // Bail out if file does not exist if (!File.Exists(fileToCopy)) { return; } CopyFileUsingXCopy(fileToCopy, VSPathUtils.GetVsInstallPath()); }
//---------- Mapping Schemes ---------------- private static void ExecuteImportMappingScheme() { // Open Browse dialog - search for VSK files. const string vskFileFilter = "VS keyboard files (*.vsk)|*.vsk|All files (*.*)|*.*"; string fileToImport = FileUtils.BrowseForFile(vskFileFilter, VSPathUtils.GetVsInstallPath()); if (!File.Exists(fileToImport)) { // No file to copy. Abort operation. return; } // Check that it's a VSK file. if (!Path.GetExtension(fileToImport).Equals(".vsk", StringComparison.InvariantCultureIgnoreCase)) { MessageBox.Show($"The chosen file is not a valid Visual Studio keyboard mapping scheme. Please chose a VSK file.", MSG_CAPTION_IMPORT_VSK); return; } // Copy VSK file to IDE directory FileUtils.CopyVSKToIDEDir(fileToImport); }
private List <string> FetchListOfMappingSchemes() { // PERFORMS FILE IO! We want to minimize how often this occurs, plus delay this call as long as possible. return(Directory.EnumerateFiles(VSPathUtils.GetVsInstallPath(), "*.vsk").Select(fn => Path.GetFileNameWithoutExtension(fn)).ToList()); }
private string GetAllUsersExtensionsPath() { return(Path.Combine(VSPathUtils.GetVsInstallPath(), "Extensions")); }
public static void CopyVSKToIDEDir(string fileToCopy) { CopyFileUsingXCopy(fileToCopy, VSPathUtils.GetVsInstallPath()); }