private static IVsProfileSettingsTree GetShortcutsSettingsTreeForImport(string importFilePath) { IVsProfileSettingsFileInfo profileSettingsFileInfo = GetProfileSettingsFileInfo(importFilePath); profileSettingsFileInfo.GetSettingsForImport(out IVsProfileSettingsTree profileSettingsTree); EnableKeyboardOnlyInProfileSettingsTree(profileSettingsTree); return(profileSettingsTree); }
public void Setup() { _manager = Mock.Create <IVsProfileDataManager>(); _errorInformation = Mock.Create <IVsSettingsErrorInformation>(); _files = Mock.Create <IVsProfileSettingsFileCollection>(); _xmlRepository = Mock.Create <IXmlRepository>(); _settingsFileInfo = Mock.Create <IVsProfileSettingsFileInfo>(); _sets = Mock.Create <IVsProfileSettingsTree>(); }
//-------- Reset Shortcuts -------- private bool ResetShortcutsViaProfileManager() { IVsProfileDataManager vsProfileDataManager = (IVsProfileDataManager)ServiceProvider.GetService(typeof(SVsProfileDataManager)); IVsProfileSettingsFileInfo profileSettingsFileInfo = GetDefaultProfileSettingsFileInfo(vsProfileDataManager); if (profileSettingsFileInfo == null) { MessageBox.Show("Unable to find Default Shortcuts file."); return(false); } // Apply the Reset int result = vsProfileDataManager.ResetSettings(profileSettingsFileInfo, out IVsSettingsErrorInformation errorInfo); if (ErrorHandler.Failed(result)) { // Something went wrong. TODO: Handle error. MessageBox.Show("Error occurred attempting to reset keyboard shortcuts."); return(false); } MessageBox.Show("Success! Keyboard shortcuts have been reset.", MSG_CAPTION_RESET, MessageBoxButtons.OK); return(true); }