mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Code cleanup
This commit is contained in:
1 parent
0d02e144ba
commit
da4b691717
70 files changed
+492
-488
No files matched your search
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
@@ -9,7 +8,6 @@ using Artemis.Core.Events;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.Core.Services.Storage;
|
||||
using Artemis.UI.ViewModels.Screens;
|
||||
using Artemis.UI.ViewModels.Utilities;
|
||||
@@ -21,7 +19,7 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
|
||||
{
|
||||
public class ProfileEditorViewModel : ModuleViewModel
|
||||
{
|
||||
private TimerUpdateTrigger _updateTrigger;
|
||||
private readonly TimerUpdateTrigger _updateTrigger;
|
||||
|
||||
public ProfileEditorViewModel(Module module, ISurfaceService surfaceService, ISettingsService settingsService) : base(module, "Profile Editor")
|
||||
{
|
||||
@@ -37,7 +35,7 @@ namespace Artemis.UI.ViewModels.Controls.ProfileEditor
|
||||
|
||||
// Borrow RGB.NET's update trigger, update up to 25 FPS, ignore higher settings than that
|
||||
var targetFps = Math.Min(settingsService.GetSetting("TargetFrameRate", 25).Value, 25);
|
||||
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / targetFps };
|
||||
_updateTrigger = new TimerUpdateTrigger {UpdateFrequency = 1.0 / targetFps};
|
||||
_updateTrigger.Update += UpdateLeds;
|
||||
|
||||
_updateTrigger.Start();
|
||||
|
||||
@@ -11,6 +11,13 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
|
||||
ApplyLedToViewModel();
|
||||
}
|
||||
|
||||
public Led Led { get; set; }
|
||||
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
|
||||
public void ApplyLedToViewModel()
|
||||
{
|
||||
X = Led.LedRectangle.X;
|
||||
@@ -18,12 +25,5 @@ namespace Artemis.UI.ViewModels.Controls.SurfaceEditor
|
||||
Width = Led.LedRectangle.Width;
|
||||
Height = Led.LedRectangle.Height;
|
||||
}
|
||||
|
||||
public Led Led { get; set; }
|
||||
|
||||
public double X { get; set; }
|
||||
public double Y { get; set; }
|
||||
public double Width { get; set; }
|
||||
public double Height { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user