Exemplo n.º 1
0
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveGeneralSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <Rubberduck.Settings.GeneralSettings> {
             FilePath = dialog.FileName
         };
         service.Save(GetCurrentGeneralSettings());
         var hkService = new XmlPersistanceService <HotkeySettings> {
             FilePath = dialog.FileName
         };
         hkService.Save(new HotkeySettings {
             Settings = Hotkeys.ToArray()
         });
     }
 }
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveUnitTestSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <Rubberduck.Settings.UnitTestSettings> {
             FilePath = dialog.FileName
         };
         service.Save(new Rubberduck.Settings.UnitTestSettings
         {
             BindingMode = BindingMode,
             AssertMode  = AssertMode,
             ModuleInit  = ModuleInit,
             MethodInit  = MethodInit,
             DefaultTestStubInNewModule = DefaultTestStubInNewModule
         });
     }
 }
Exemplo n.º 3
0
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveWindowSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <Rubberduck.Settings.WindowSettings> {
             FilePath = dialog.FileName
         };
         service.Save(new Rubberduck.Settings.WindowSettings()
         {
             CodeExplorerVisibleOnStartup    = CodeExplorerVisibleOnStartup,
             CodeInspectionsVisibleOnStartup = CodeInspectionsVisibleOnStartup,
             SourceControlVisibleOnStartup   = SourceControlVisibleOnStartup,
             TestExplorerVisibleOnStartup    = TestExplorerVisibleOnStartup,
             TodoExplorerVisibleOnStartup    = TodoExplorerVisibleOnStartup
         });
     }
 }
Exemplo n.º 4
0
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveIndenterSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <SmartIndenter.IndenterSettings> {
             FilePath = dialog.FileName
         };
         service.Save((SmartIndenter.IndenterSettings)GetCurrentSettings());
     }
 }
Exemplo n.º 5
0
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveToDoSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <ToDoListSettings> {
             FilePath = dialog.FileName
         };
         service.Save(new ToDoListSettings {
             ToDoMarkers = TodoSettings.Select(m => new ToDoMarker(m.Text.ToUpperInvariant())).Distinct().ToArray()
         });
     }
 }
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = SettingsUI.DialogMask_XmlFilesOnly,
         Title = SettingsUI.DialogCaption_SaveAutocompletionSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <Rubberduck.Settings.AutoCompleteSettings> {
             FilePath = dialog.FileName
         };
         service.Save(new Rubberduck.Settings.AutoCompleteSettings
         {
             IsEnabled       = IsEnabled,
             BlockCompletion = new Rubberduck.Settings.AutoCompleteSettings.BlockCompletionSettings
             {
                 CompleteOnEnter = CompleteBlockOnEnter,
                 CompleteOnTab   = CompleteBlockOnTab,
                 IsEnabled       = EnableBlockCompletion
             },
             SelfClosingPairs = new Rubberduck.Settings.AutoCompleteSettings.SelfClosingPairSettings
             {
                 IsEnabled = EnableSelfClosingPairs
             },
             SmartConcat = new Rubberduck.Settings.AutoCompleteSettings.SmartConcatSettings
             {
                 ConcatVbNewLineModifier =
                     ConcatVbNewLine ? ModifierKeySetting.CtrlKey : ModifierKeySetting.None,
                 IsEnabled = EnableSmartConcat
             }
         });
     }
 }
Exemplo n.º 7
0
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveInspectionSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <Rubberduck.Settings.AutoCompleteSettings> {
             FilePath = dialog.FileName
         };
         service.Save(new Rubberduck.Settings.AutoCompleteSettings
         {
             CompleteBlockOnTab = this.CompleteBlockOnTab,
             AutoCompletes      = new HashSet <AutoCompleteSetting>(Settings),
         });
     }
 }
 private void ExportSettings()
 {
     using (var dialog = new SaveFileDialog
     {
         Filter = RubberduckUI.DialogMask_XmlFilesOnly,
         Title = RubberduckUI.DialogCaption_SaveInspectionSettings
     })
     {
         dialog.ShowDialog();
         if (string.IsNullOrEmpty(dialog.FileName))
         {
             return;
         }
         var service = new XmlPersistanceService <CodeInspectionSettings> {
             FilePath = dialog.FileName
         };
         service.Save(new CodeInspectionSettings
         {
             CodeInspections                 = new HashSet <CodeInspectionSetting>(InspectionSettings.SourceCollection.OfType <CodeInspectionSetting>()),
             WhitelistedIdentifiers          = WhitelistedIdentifierSettings.Distinct().ToArray(),
             RunInspectionsOnSuccessfulParse = _runInspectionsOnSuccessfulParse
         });
     }
 }