check point
This commit is contained in:
34
VisionBuilder.UI.Windows/Services/SettingsService.cs
Normal file
34
VisionBuilder.UI.Windows/Services/SettingsService.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Inspectron.Settings;
|
||||
using Inspectron.Settings.Windows.Configuration;
|
||||
using VisionBuilder.UI.Common;
|
||||
using VisionBuilder.UI.Common.ViewModel.Interfaces.UI;
|
||||
|
||||
namespace VisionBuilder.UI.Windows.Settings;
|
||||
|
||||
public class SettingsService: ISettingsService
|
||||
{
|
||||
private readonly UIConfiguration _uiConfiguration;
|
||||
private readonly InspectronSettings _settings;
|
||||
|
||||
public SettingsService(UIConfiguration uiConfiguration, InspectronSettings settings)
|
||||
{
|
||||
_uiConfiguration = uiConfiguration ?? throw new ArgumentNullException(nameof(uiConfiguration));
|
||||
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
|
||||
|
||||
}
|
||||
|
||||
public void ShowSettingsDialog()
|
||||
{
|
||||
Thread th = new Thread(() =>
|
||||
{
|
||||
OptionsWindow window = new OptionsWindow(new DefaultControlFactory());
|
||||
window.LoadFromSettings(_settings);
|
||||
if (window.ShowDialog()==DialogResult.OK)
|
||||
{
|
||||
_settings.SaveSettings();
|
||||
}
|
||||
});
|
||||
th.SetApartmentState(ApartmentState.STA);
|
||||
th.Start();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user