public void Set_ValueIsntNull_CalleImportSettings()
        {
            //Arrange
            Mock.Arrange(() => _manager.ImportSettings(_sets, out _errorInformation))
            .MustBeCalled();
            Mock.Arrange(() => _manager.GetSettingsFiles(0, out _files));
            Mock.Arrange(() => _files.AddBrowseFile(Arg.AnyString, out _settingsFileInfo)).DoNothing();

            //Act
            CreateController().Set(Value);

            //Assert
            Mock.AssertAll(_xmlRepository);
        }
Exemple #2
0
        private static bool ImportSettingsFromSettingsTree(IVsProfileSettingsTree profileSettingsTree)
        {
            //EnableKeyboardOnlyInProfileSettingsTree(profileSettingsTree);
            IVsProfileDataManager vsProfileDataManager = (IVsProfileDataManager)Package.GetGlobalService(typeof(SVsProfileDataManager));
            int result = vsProfileDataManager.ImportSettings(profileSettingsTree, out IVsSettingsErrorInformation errorInfo);

            if (ErrorHandler.Failed(result))
            {
                // Something went wrong. TODO: Handle error.
                MessageBox.Show("Error occurred attempting to import settings.");
                return(false);
            }
            return(true);
        }
        public void Set(string value)
        {
            if (string.IsNullOrEmpty(value))
            {
                throw new ArgumentNullException("value");
            }

            IVsProfileSettingsFileInfo       settingsFileInfo;
            IVsProfileSettingsFileCollection files;
            IVsProfileSettingsTree           sets;

            _xmlRepository.SetXml(_fullPath, value);
            _manager.GetSettingsFiles(0, out files);
            files.AddBrowseFile(_fullPath, out settingsFileInfo);
            settingsFileInfo.GetSettingsForImport(out sets);
            _manager.ImportSettings(sets, out _errorInformation);
        }