コード例 #1
0
        public static void CopyVSKToIDEDir(string fileToCopy)
        {
            // Bail out if file does not exist
            if (!File.Exists(fileToCopy))
            {
                return;
            }

            CopyFileUsingXCopy(fileToCopy, VSPathUtils.GetVsInstallPath());
        }
コード例 #2
0
        //---------- 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);
        }
コード例 #3
0
 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());
 }
コード例 #4
0
 private string GetAllUsersExtensionsPath()
 {
     return(Path.Combine(VSPathUtils.GetVsInstallPath(), "Extensions"));
 }
コード例 #5
0
 public static void CopyVSKToIDEDir(string fileToCopy)
 {
     CopyFileUsingXCopy(fileToCopy, VSPathUtils.GetVsInstallPath());
 }