7
7
8
8
namespace Rubberduck . UI . Settings
9
9
{
10
- public sealed class UnitTestSettingsViewModel : SettingsViewModelBase < Rubberduck . Settings . UnitTestSettings > , ISettingsViewModel < Rubberduck . Settings . UnitTestSettings >
10
+ public sealed class UnitTestSettingsViewModel : SettingsViewModelBase < Rubberduck . UnitTesting . Settings . UnitTestSettings > , ISettingsViewModel < Rubberduck . UnitTesting . Settings . UnitTestSettings >
11
11
{
12
- public UnitTestSettingsViewModel ( Configuration config , IFilePersistanceService < Rubberduck . Settings . UnitTestSettings > service )
12
+ public UnitTestSettingsViewModel ( Configuration config , IFilePersistanceService < Rubberduck . UnitTesting . Settings . UnitTestSettings > service )
13
13
: base ( service )
14
14
{
15
15
BindingMode = config . UserSettings . UnitTestSettings . BindingMode ;
@@ -18,7 +18,7 @@ public UnitTestSettingsViewModel(Configuration config, IFilePersistanceService<R
18
18
MethodInit = config . UserSettings . UnitTestSettings . MethodInit ;
19
19
DefaultTestStubInNewModule = config . UserSettings . UnitTestSettings . DefaultTestStubInNewModule ;
20
20
ExportButtonCommand = new DelegateCommand ( LogManager . GetCurrentClassLogger ( ) ,
21
- _ => ExportSettings ( new Rubberduck . Settings . UnitTestSettings ( BindingMode , AssertMode , ModuleInit ,
21
+ _ => ExportSettings ( new Rubberduck . UnitTesting . Settings . UnitTestSettings ( BindingMode , AssertMode , ModuleInit ,
22
22
MethodInit , DefaultTestStubInNewModule ) ) ) ;
23
23
ImportButtonCommand = new DelegateCommand ( LogManager . GetCurrentClassLogger ( ) , _ => ImportSettings ( ) ) ;
24
24
}
@@ -114,44 +114,13 @@ public void SetToDefaults(Configuration config)
114
114
115
115
protected override string DialogLoadTitle => SettingsUI . DialogCaption_LoadUnitTestSettings ;
116
116
protected override string DialogSaveTitle => SettingsUI . DialogCaption_SaveUnitTestSettings ;
117
- protected override void TransferSettingsToView ( Rubberduck . Settings . UnitTestSettings toLoad )
117
+ protected override void TransferSettingsToView ( Rubberduck . UnitTesting . Settings . UnitTestSettings toLoad )
118
118
{
119
119
BindingMode = toLoad . BindingMode ;
120
120
AssertMode = toLoad . AssertMode ;
121
121
ModuleInit = toLoad . ModuleInit ;
122
122
MethodInit = toLoad . MethodInit ;
123
123
DefaultTestStubInNewModule = toLoad . DefaultTestStubInNewModule ;
124
124
}
125
-
126
- private void ImportSettings ( )
127
- {
128
- using ( var dialog = new OpenFileDialog
129
- {
130
- Filter = SettingsUI . DialogMask_XmlFilesOnly ,
131
- Title = SettingsUI . DialogCaption_LoadUnitTestSettings
132
- } )
133
- {
134
- dialog . ShowDialog ( ) ;
135
- if ( string . IsNullOrEmpty ( dialog . FileName ) ) return ;
136
- var service = new XmlPersistanceService < Rubberduck . UnitTesting . Settings . UnitTestSettings > { FilePath = dialog . FileName } ;
137
- var loaded = service . Load ( new Rubberduck . UnitTesting . Settings . UnitTestSettings ( ) ) ;
138
- TransferSettingsToView ( loaded ) ;
139
- }
140
- }
141
-
142
- private void ExportSettings ( )
143
- {
144
- using ( var dialog = new SaveFileDialog
145
- {
146
- Filter = SettingsUI . DialogMask_XmlFilesOnly ,
147
- Title = SettingsUI . DialogCaption_SaveUnitTestSettings
148
- } )
149
- {
150
- dialog . ShowDialog ( ) ;
151
- if ( string . IsNullOrEmpty ( dialog . FileName ) ) return ;
152
- var service = new XmlPersistanceService < Rubberduck . UnitTesting . Settings . UnitTestSettings > { FilePath = dialog . FileName } ;
153
- service . Save ( new Rubberduck . UnitTesting . Settings . UnitTestSettings ( BindingMode , AssertMode , ModuleInit , MethodInit , DefaultTestStubInNewModule ) ) ;
154
- }
155
- }
156
125
}
157
126
}
0 commit comments