From a3b983fb9c6407418a423266d9383bb75ac011d1 Mon Sep 17 00:00:00 2001 From: SpoinkyNL Date: Wed, 27 Apr 2016 20:40:41 +0200 Subject: [PATCH] Resharper cleanup on entire project --- Artemis/Artemis/App.config | 59 +++++++++--- .../KeyboardProviders/Corsair/CorsairRGB.cs | 2 +- .../KeyboardProviders/KeyboardRegion.cs | 3 +- .../KeyboardProviders/Logitech/Orion.cs | 3 +- .../Logitech/Utilities/OrionUtilities.cs | 8 +- .../Razer/Utilities/RazerUtilities.cs | 2 - Artemis/Artemis/Managers/EffectManager.cs | 3 +- Artemis/Artemis/Models/GameModel.cs | 11 +-- .../Profiles/LayerDynamicPropertiesModel.cs | 2 +- .../AmbientLightningEffectModel.cs | 9 +- .../AmbientLightningEffectView.xaml | 94 +++++++++---------- .../AmbientLightningEffectView.xaml.cs | 19 +--- .../Effects/AmbientLightning/ScreenCapture.cs | 2 +- .../Modules/Effects/TypeWave/TypeWaveModel.cs | 6 +- .../Games/CounterStrike/CounterStrikeModel.cs | 3 +- .../CounterStrike/CounterStrikeViewModel.cs | 7 +- .../Modules/Games/Dota2/Dota2.settings | 4 +- .../Modules/Games/Dota2/Dota2DataModel.cs | 2 +- .../Modules/Games/Dota2/Dota2Settings.cs | 53 +++++------ .../Modules/Games/Dota2/Dota2View.xaml | 19 ++-- .../Modules/Games/Dota2/Dota2ViewModel.cs | 3 +- .../Games/RocketLeague/RocketLeagueView.xaml | 2 +- .../RocketLeague/RocketLeagueViewModel.cs | 3 +- .../Games/TheDivision/TheDivision.settings | 4 +- .../Games/TheDivision/TheDivisionDataModel.cs | 5 +- .../Games/TheDivision/TheDivisionView.xaml | 12 +-- .../Games/TheDivision/TheDivisionView.xaml.cs | 19 +--- .../Games/TheDivision/TheDivisionViewModel.cs | 4 +- .../Games/Witcher3/Witcher3ViewModel.cs | 3 +- .../Artemis/Services/MetroDialogService.cs | 8 +- Artemis/Artemis/Settings/General.settings | 4 +- .../Artemis/Styles/Accents/CorsairYellow.xaml | 30 ++++-- Artemis/Artemis/Styles/ColorBox.xaml | 19 ++-- Artemis/Artemis/Utilities/GeneralHelpers.cs | 8 +- .../Utilities/Keyboard/KeyboardHook.cs | 2 +- .../Utilities/LogitechDll/DllManager.cs | 2 +- .../Utilities/LogitechDll/NamedPipeServer.cs | 3 - .../ParentChild/ChildItemCollection.cs | 12 +-- .../ViewModels/Abstract/GameViewModel.cs | 5 +- .../Artemis/ViewModels/EffectsViewModel.cs | 1 - Artemis/Artemis/ViewModels/GamesViewModel.cs | 2 +- .../Artemis/ViewModels/SystemTrayViewModel.cs | 1 - .../Views/LayerEditor/LayerConditionView.xaml | 4 +- .../LayerEditor/LayerConditionView.xaml.cs | 19 +--- .../LayerDynamicPropertiesView.xaml | 3 +- .../LayerDynamicPropertiesView.xaml.cs | 19 +--- .../Views/LayerEditor/LayerEditorView.xaml | 3 +- .../Views/LayerEditor/LayerEditorView.xaml.cs | 4 +- Artemis/Artemis/Views/ProfileEditorView.xaml | 13 ++- .../Artemis/Views/ProfileEditorView.xaml.cs | 19 +--- Artemis/Artemis/Views/ShellView.xaml | 5 +- Artemis/Artemis/packages.config | 1 + 52 files changed, 265 insertions(+), 288 deletions(-) diff --git a/Artemis/Artemis/App.config b/Artemis/Artemis/App.config index c2fc93200..9c4523b0b 100644 --- a/Artemis/Artemis/App.config +++ b/Artemis/Artemis/App.config @@ -2,21 +2,50 @@ - -
-
-
-
-
-
-
-
-
-
-
-
-
-
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs b/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs index 2802ebf11..8e451a9ca 100644 --- a/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs +++ b/Artemis/Artemis/KeyboardProviders/Corsair/CorsairRGB.cs @@ -76,7 +76,7 @@ namespace Artemis.KeyboardProviders.Corsair case "K95 RGB": Height = 7; Width = 25; - PreviewSettings = new PreviewSettings(626, 175, new Thickness(0,-15,0,0), Resources.k95); + PreviewSettings = new PreviewSettings(626, 175, new Thickness(0, -15, 0, 0), Resources.k95); KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(20, 1))); KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(21, 2), new Point(25, 7))); KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(5, 3), new Point(8, 3))); diff --git a/Artemis/Artemis/KeyboardProviders/KeyboardRegion.cs b/Artemis/Artemis/KeyboardProviders/KeyboardRegion.cs index 59f4565e6..c82e98d77 100644 --- a/Artemis/Artemis/KeyboardProviders/KeyboardRegion.cs +++ b/Artemis/Artemis/KeyboardProviders/KeyboardRegion.cs @@ -15,6 +15,7 @@ namespace Artemis.KeyboardProviders public Point TopLeft { get; set; } public Point BottomRight { get; set; } - public Rectangle GetRectangle() => new Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X - TopLeft.X, BottomRight.Y - TopLeft.Y); + public Rectangle GetRectangle() + => new Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X - TopLeft.X, BottomRight.Y - TopLeft.Y); } } \ No newline at end of file diff --git a/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs b/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs index 2c5c356db..ce23deaed 100644 --- a/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs +++ b/Artemis/Artemis/KeyboardProviders/Logitech/Orion.cs @@ -5,7 +5,6 @@ using System.Windows; using Artemis.KeyboardProviders.Logitech.Utilities; using Artemis.Properties; using Artemis.Utilities; -using Artemis.Utilities.LogitechDll; using Point = System.Drawing.Point; namespace Artemis.KeyboardProviders.Logitech @@ -27,7 +26,7 @@ namespace Artemis.KeyboardProviders.Logitech new KeyboardRegion("TopRow", new Point(0, 0), new Point(18, 0)), new KeyboardRegion("NumPad", new Point(17, 1), new Point(21, 6)), new KeyboardRegion("QWER", new Point(2, 2), new Point(5, 2)) - }; + }; } public override bool CanEnable() diff --git a/Artemis/Artemis/KeyboardProviders/Logitech/Utilities/OrionUtilities.cs b/Artemis/Artemis/KeyboardProviders/Logitech/Utilities/OrionUtilities.cs index 98f38c569..4016a271a 100644 --- a/Artemis/Artemis/KeyboardProviders/Logitech/Utilities/OrionUtilities.cs +++ b/Artemis/Artemis/KeyboardProviders/Logitech/Utilities/OrionUtilities.cs @@ -146,7 +146,7 @@ namespace Artemis.KeyboardProviders.Logitech.Utilities new KeyMapping(120, 121), new KeyMapping(121, 122), new KeyMapping(122, 123), - new KeyMapping(124, 124), + new KeyMapping(124, 124) }; public static byte[] BitmapToByteArray(Bitmap b, bool remap = true) @@ -171,10 +171,10 @@ namespace Artemis.KeyboardProviders.Logitech.Utilities var remapped = new byte[pixels.Length]; // Every key is 4 bytes - for (var i = 0; i <= pixels.Length /4; i++) + for (var i = 0; i <= pixels.Length/4; i++) { - var firstSByte = Keymappings[i].Source * 4; - var firstTByte = Keymappings[i].Target * 4; + var firstSByte = Keymappings[i].Source*4; + var firstTByte = Keymappings[i].Target*4; for (var j = 0; j < 4; j++) remapped[firstTByte + j] = pixels[firstSByte + j]; diff --git a/Artemis/Artemis/KeyboardProviders/Razer/Utilities/RazerUtilities.cs b/Artemis/Artemis/KeyboardProviders/Razer/Utilities/RazerUtilities.cs index fcb8cf5c0..cdf025df9 100644 --- a/Artemis/Artemis/KeyboardProviders/Razer/Utilities/RazerUtilities.cs +++ b/Artemis/Artemis/KeyboardProviders/Razer/Utilities/RazerUtilities.cs @@ -1,6 +1,4 @@ using System.Drawing; -using System.Drawing.Drawing2D; -using System.Drawing.Imaging; using Artemis.Utilities; using Corale.Colore.Razer.Keyboard.Effects; diff --git a/Artemis/Artemis/Managers/EffectManager.cs b/Artemis/Artemis/Managers/EffectManager.cs index 5e90e4052..39cc7c342 100644 --- a/Artemis/Artemis/Managers/EffectManager.cs +++ b/Artemis/Artemis/Managers/EffectManager.cs @@ -19,7 +19,6 @@ namespace Artemis.Managers private readonly MainManager _mainManager; private EffectModel _activeEffect; private bool _clearing; - public EffectModel PauseEffect { get; set; } public EffectManager(MainManager mainManager, IEventAggregator events) { @@ -32,6 +31,8 @@ namespace Artemis.Managers Logger.Info("Intialized EffectManager"); } + public EffectModel PauseEffect { get; set; } + /// /// Used by ViewModels to show a preview of the profile currently being edited /// diff --git a/Artemis/Artemis/Models/GameModel.cs b/Artemis/Artemis/Models/GameModel.cs index 5e4fcebd8..ab209277e 100644 --- a/Artemis/Artemis/Models/GameModel.cs +++ b/Artemis/Artemis/Models/GameModel.cs @@ -1,21 +1,20 @@ using Artemis.Managers; using Artemis.Models.Interfaces; using Artemis.Models.Profiles; -using Artemis.Modules.Games.Witcher3; namespace Artemis.Models { public abstract class GameModel : EffectModel { + protected GameModel(MainManager mainManager, GameSettings settings) : base(mainManager) + { + Settings = settings; + } + public GameSettings Settings { get; set; } public bool Enabled { get; set; } public string ProcessName { get; set; } public IGameDataModel GameDataModel { get; set; } public ProfileModel Profile { get; set; } - - protected GameModel(MainManager mainManager, GameSettings settings) : base(mainManager) - { - Settings = settings; - } } } \ No newline at end of file diff --git a/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs b/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs index 43af20b1e..8d9d605fa 100644 --- a/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs +++ b/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs @@ -47,7 +47,7 @@ namespace Artemis.Models.Profiles if (layerProp == null || userProp == null) return; - var percentage = ToDouble(gameProperty) / percentageSource; + var percentage = ToDouble(gameProperty)/percentageSource; layerProp.SetValue(props, (int) (percentage*(int) userProp.GetValue(userProps, null))); } diff --git a/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectModel.cs b/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectModel.cs index 8f97f156c..27140f257 100644 --- a/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectModel.cs +++ b/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectModel.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Windows.Forms; using Artemis.Managers; using Artemis.Models; -using Artemis.Utilities; using Artemis.Utilities.Keyboard; using Kaliko.ImageLibrary; using Kaliko.ImageLibrary.Filters; @@ -54,7 +53,7 @@ namespace Artemis.Modules.Effects.AmbientLightning LinearGradientMode.Horizontal) {Height = MainManager.KeyboardManager.ActiveKeyboard.Height*Scale/2}; _botRect = new KeyboardRectangle(MainManager.KeyboardManager.ActiveKeyboard, 0, 0, new List(), LinearGradientMode.Horizontal); - + Initialized = true; } @@ -96,7 +95,8 @@ namespace Artemis.Modules.Effects.AmbientLightning if (_colors.Count <= colorIndex) _colors.Add(Color.FromArgb(255, averageR, averageG, averageB)); else - _colors[colorIndex] = Color.FromArgb(255, (averageR + _colors[colorIndex].R * 5) / 6, (averageG + _colors[colorIndex].G * 5) / 6, (averageB + _colors[colorIndex].B * 5) / 6); + _colors[colorIndex] = Color.FromArgb(255, (averageR + _colors[colorIndex].R*5)/6, + (averageG + _colors[colorIndex].G*5)/6, (averageB + _colors[colorIndex].B*5)/6); colorIndex++; } } @@ -108,7 +108,7 @@ namespace Artemis.Modules.Effects.AmbientLightning { for (var column = 0; column < 3; column++) { - var rectBase = new Point(rectWidth * column, rectHeight * row); + var rectBase = new Point(rectWidth*column, rectHeight*row); _rectangles.Add(new Rectangle(rectBase.X, rectBase.Y, rectWidth, rectHeight)); } } @@ -133,7 +133,6 @@ namespace Artemis.Modules.Effects.AmbientLightning test.SaveBmp(ms); ms.Position = 0; return new Bitmap(ms); - } } } \ No newline at end of file diff --git a/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectView.xaml b/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectView.xaml index 55bdfba58..3621b1189 100644 --- a/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectView.xaml +++ b/Artemis/Artemis/Modules/Effects/AmbientLightning/AmbientLightningEffectView.xaml @@ -1,55 +1,55 @@  - - - - - - - - - - - - - - - - - - - - - - - - - -