Made SurfaceService solely responsible for keeping the surface and the config in sync and saved

This commit is contained in:
Robert Beekman committed 2019-10-24 00:05:36 +02:00
1 parent 9badc666e8
commit 3dc8fa6b1c
5 files changed
+85 -89

No files matched your search

+6 -5
View File
@@ -152,6 +152,11 @@
<Compile Include="Extensions\RgbColorExtensions.cs" />
<Compile Include="Extensions\RgbRectangleExtensions.cs" />
<Compile Include="Ninject\UIModule.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Services\Interfaces\IArtemisUIService.cs" />
<Compile Include="Stylet\ArtemisViewManager.cs" />
<Compile Include="Stylet\NinjectBootstrapper.cs" />
@@ -214,11 +219,6 @@
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
@@ -226,6 +226,7 @@
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<SubType>Designer</SubType>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="packages.config" />
@@ -70,7 +70,7 @@ namespace Artemis.UI.ViewModels.Screens
if (activeConfig == null)
{
activeConfig = AddSurfaceConfiguration("Default");
_surfaceService.ActiveSurfaceConfiguration = activeConfig;
_surfaceService.SetActiveSurfaceConfiguration(activeConfig);
}
Execute.OnUIThread(() =>
@@ -106,7 +106,7 @@ namespace Artemis.UI.ViewModels.Screens
});
});
_surfaceService.ActiveSurfaceConfiguration = SelectedSurfaceConfiguration;
_surfaceService.SetActiveSurfaceConfiguration(SelectedSurfaceConfiguration);
}
#region Overrides of Screen
@@ -275,9 +275,7 @@ namespace Artemis.UI.ViewModels.Screens
}
else
{
foreach (var device in Devices)
device.DeviceConfiguration.ApplyToDevice();
_surfaceService.SaveToRepository(SelectedSurfaceConfiguration, true);
_surfaceService.UpdateSurfaceConfiguration(SelectedSurfaceConfiguration, true);
}
Mouse.OverrideCursor = null;