示例#1
0
        private void ConfigServiceSettingsChanged(object sender, EventArgs e)
        {
            _config = _configService.LoadConfiguration();

            _timer.Enabled = _config.UserSettings.GeneralSettings.AutoSaveEnabled;
            _timer.Interval = _config.UserSettings.GeneralSettings.AutoSavePeriod * 1000;
        }
 public void UpdateConfig(Configuration config)
 {
     config.UserSettings.GeneralSettings.Language = SelectedLanguage;
     config.UserSettings.GeneralSettings.HotkeySettings = Hotkeys.ToArray();
     config.UserSettings.GeneralSettings.AutoSaveEnabled = AutoSaveEnabled;
     config.UserSettings.GeneralSettings.AutoSavePeriod = AutoSavePeriod;
 }
 public UnitTestSettingsViewModel(Configuration config)
 {
     BindingMode = config.UserSettings.UnitTestSettings.BindingMode;
     AssertMode = config.UserSettings.UnitTestSettings.AssertMode;
     ModuleInit = config.UserSettings.UnitTestSettings.ModuleInit;
     MethodInit = config.UserSettings.UnitTestSettings.MethodInit;
     DefaultTestStubInNewModule = config.UserSettings.UnitTestSettings.DefaultTestStubInNewModule;
 }
        public InspectionSettingsViewModel(Configuration config)
        {
            InspectionSettings = new ListCollectionView(
                    config.UserSettings.CodeInspectionSettings.CodeInspections.ToList());

            if (InspectionSettings.GroupDescriptions != null)
            {
                InspectionSettings.GroupDescriptions.Add(new PropertyGroupDescription("TypeLabel"));
            }
        }
示例#5
0
        private void LoadConfig()
        {
            _config = _configService.LoadConfiguration();

            var currentCulture = RubberduckUI.Culture;
            try
            {
                RubberduckUI.Culture = CultureInfo.GetCultureInfo(_config.UserSettings.LanguageSetting.Code);
            }
            catch (CultureNotFoundException exception)
            {
                MessageBox.Show(exception.Message, "Rubberduck", MessageBoxButtons.OK, MessageBoxIcon.Error);
                _config.UserSettings.LanguageSetting.Code = currentCulture.Name;
                _configService.SaveConfiguration(_config);
            }
        }
        public GeneralSettingsViewModel(Configuration config)
        {
            Languages = new ObservableCollection<DisplayLanguageSetting>(
                new[] 
            {
                new DisplayLanguageSetting("en-US"),
                new DisplayLanguageSetting("fr-CA"),
                new DisplayLanguageSetting("de-DE"),
                new DisplayLanguageSetting("sv-SE"),
                new DisplayLanguageSetting("ja-JP")
            });

            SelectedLanguage = Languages.First(l => l.Code == config.UserSettings.GeneralSettings.Language.Code);

            Hotkeys = new ObservableCollection<HotkeySetting>(config.UserSettings.GeneralSettings.HotkeySettings);
            AutoSaveEnabled = config.UserSettings.GeneralSettings.AutoSaveEnabled;
            AutoSavePeriod = config.UserSettings.GeneralSettings.AutoSavePeriod;
        }
        public IndenterSettingsViewModel(Configuration config)
        {
            AlignCommentsWithCode = config.UserSettings.IndenterSettings.AlignCommentsWithCode;
            AlignContinuations = config.UserSettings.IndenterSettings.AlignContinuations;
            AlignDimColumn = config.UserSettings.IndenterSettings.AlignDimColumn;
            AlignDims = config.UserSettings.IndenterSettings.AlignDims;
            EnableUndo = config.UserSettings.IndenterSettings.EnableUndo;
            EndOfLineCommentColumnSpaceAlignment = config.UserSettings.IndenterSettings.EndOfLineCommentColumnSpaceAlignment;
            EndOfLineCommentStyle = config.UserSettings.IndenterSettings.EndOfLineCommentStyle;
            ForceCompilerDirectivesInColumn1 = config.UserSettings.IndenterSettings.ForceCompilerDirectivesInColumn1;
            ForceDebugStatementsInColumn1 = config.UserSettings.IndenterSettings.ForceDebugStatementsInColumn1;
            IgnoreOperatorsInContinuations = config.UserSettings.IndenterSettings.IgnoreOperatorsInContinuations;
            IndentCase = config.UserSettings.IndenterSettings.IndentCase;
            IndentCompilerDirectives = config.UserSettings.IndenterSettings.IndentCompilerDirectives;
            IndentEntireProcedureBody = config.UserSettings.IndenterSettings.IndentEntireProcedureBody;
            IndentFirstCommentBlock = config.UserSettings.IndenterSettings.IndentFirstCommentBlock;
            IndentFirstDeclarationBlock = config.UserSettings.IndenterSettings.IndentFirstDeclarationBlock;
            IndentSpaces = config.UserSettings.IndenterSettings.IndentSpaces;

            PropertyChanged += IndenterSettingsViewModel_PropertyChanged;
        }
        public SettingsControlViewModel(IGeneralConfigService configService,
            Configuration config,
            SettingsView generalSettings,
            SettingsView todoSettings,
            SettingsView inspectionSettings,
            SettingsView unitTestSettings,
            SettingsView indenterSettings,
            SettingsViews activeView = Settings.SettingsViews.GeneralSettings)
        {
            _configService = configService;
            _config = config;

            SettingsViews = new ObservableCollection<SettingsView>
            {
                generalSettings, todoSettings, inspectionSettings, unitTestSettings, indenterSettings
            };

            SelectedSettingsView = SettingsViews.First(v => v.View == activeView);

            _okButtonCommand = new DelegateCommand(_ => SaveAndCloseWindow());
            _cancelButtonCommand = new DelegateCommand(_ => CloseWindow());
            _resetButtonCommand = new DelegateCommand(_ => ResetSettings());
        }
 public void UpdateConfig(Configuration config)
 {
     config.UserSettings.UnitTestSettings.BindingMode = BindingMode;
     config.UserSettings.UnitTestSettings.AssertMode = AssertMode;
     config.UserSettings.UnitTestSettings.ModuleInit = ModuleInit;
     config.UserSettings.UnitTestSettings.MethodInit = MethodInit;
     config.UserSettings.UnitTestSettings.DefaultTestStubInNewModule = DefaultTestStubInNewModule;
 }
 public void UpdateConfig(Configuration config)
 {
     config.UserSettings.ToDoListSettings.ToDoMarkers = TodoSettings.ToArray();
 }
        private ConfigurationLoader GetConfigLoader(Configuration config)
        {
            var configLoader = new ConfigurationLoader(Inspections(), null);
            configLoader.SaveConfiguration(config);

            return configLoader;
        }
 public void UpdateConfig(Configuration config)
 {
     config.UserSettings.CodeInspectionSettings.CodeInspections =
         InspectionSettings.SourceCollection.OfType<CodeInspectionSetting>().ToArray();
 }
 public void SetToDefaults(Configuration config)
 {
     SelectedLanguage = Languages.First(l => l.Code == config.UserSettings.GeneralSettings.Language.Code);
     Hotkeys = new ObservableCollection<HotkeySetting>(config.UserSettings.GeneralSettings.HotkeySettings);
     AutoSaveEnabled = config.UserSettings.GeneralSettings.AutoSaveEnabled;
     AutoSavePeriod = config.UserSettings.GeneralSettings.AutoSavePeriod;
 }
 public ConfigurationTreeViewControl(Configuration config) : this()
 {
     _config = config;
     InitializeTreeView();
 }
示例#15
0
        public _SettingsDialog(IGeneralConfigService configService)
            : this()
        {
            _configService = configService;
            _config = _configService.LoadConfiguration();
            _codeInspectionSettings = _config.UserSettings.CodeInspectionSettings.CodeInspections;

            LoadWindow();

            RegisterEvents();
        }
示例#16
0
        private void _configService_SettingsChanged(object sender, EventArgs e)
        {
            _config = _configService.LoadConfiguration();

            LoadWindow();
        }
 public void SetToDefaults(Configuration config)
 {
     TodoSettings = new ObservableCollection<ToDoMarker>(
             config.UserSettings.ToDoListSettings.ToDoMarkers);
 }
 public void UpdateConfig(Configuration config)
 {
     config.UserSettings.IndenterSettings.AlignCommentsWithCode = AlignCommentsWithCode;
     config.UserSettings.IndenterSettings.AlignContinuations = AlignContinuations;
     config.UserSettings.IndenterSettings.AlignDimColumn = AlignDimColumn;
     config.UserSettings.IndenterSettings.AlignDims = AlignDims;
     config.UserSettings.IndenterSettings.EnableUndo = EnableUndo;
     config.UserSettings.IndenterSettings.EndOfLineCommentColumnSpaceAlignment = EndOfLineCommentColumnSpaceAlignment;
     config.UserSettings.IndenterSettings.EndOfLineCommentStyle = EndOfLineCommentStyle;
     config.UserSettings.IndenterSettings.ForceCompilerDirectivesInColumn1 = ForceCompilerDirectivesInColumn1;
     config.UserSettings.IndenterSettings.ForceDebugStatementsInColumn1 = ForceDebugStatementsInColumn1;
     config.UserSettings.IndenterSettings.IgnoreOperatorsInContinuations = IgnoreOperatorsInContinuations;
     config.UserSettings.IndenterSettings.IndentCase = IndentCase;
     config.UserSettings.IndenterSettings.IndentCompilerDirectives = IndentCompilerDirectives;
     config.UserSettings.IndenterSettings.IndentEntireProcedureBody = IndentEntireProcedureBody;
     config.UserSettings.IndenterSettings.IndentFirstCommentBlock = IndentFirstCommentBlock;
     config.UserSettings.IndenterSettings.IndentFirstDeclarationBlock = IndentFirstDeclarationBlock;
     config.UserSettings.IndenterSettings.IndentSpaces = IndentSpaces;
 }
 public TodoSettingsViewModel(Configuration config)
 {
     TodoSettings = new ObservableCollection<ToDoMarker>(
             config.UserSettings.ToDoListSettings.ToDoMarkers);
 }