Refactoring

This commit is contained in:
DarthAffe committed 2016-02-07 10:06:07 +01:00
1 parent 0b6ba617ac
commit 089cada426
21 files changed
+58 -19

No files matched your search

+3 -1
View File
@@ -1,4 +1,6 @@
using System.Drawing;
// ReSharper disable VirtualMemberNeverOverriden.Global
using System.Drawing;
using CUE.NET.Helper;
namespace CUE.NET.Brushes
+2
View File
@@ -1,3 +1,5 @@
// ReSharper disable UnusedMemberInSuper.Global
using System.Drawing;
namespace CUE.NET.Brushes
+1
View File
@@ -2,6 +2,7 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable ReturnTypeCanBeEnumerable.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
// ReSharper disable UnusedMember.Global
using System.Drawing;
using CUE.NET.Gradients;
+1
View File
@@ -1,5 +1,6 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
// ReSharper disable UnusedMember.Global
using System;
using System.Drawing;
+3 -1
View File
@@ -1,4 +1,6 @@
using System;
// ReSharper disable UnusedMember.Global
using System;
using System.Drawing;
using CUE.NET.Helper;
+4 -1
View File
@@ -1,4 +1,7 @@
using System;
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMethodReturnValue.Global
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
+1
View File
@@ -1,5 +1,6 @@
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System.Collections;
using System.Collections.Generic;
+4 -1
View File
@@ -1,4 +1,7 @@
using CUE.NET.Devices.Generic;
// ReSharper disable UnusedMemberInSuper.Global
// ReSharper disable UnusedMember.Global
using CUE.NET.Devices.Generic;
using CUE.NET.Devices.Generic.Enums;
namespace CUE.NET.Devices
+4 -1
View File
@@ -1,4 +1,7 @@
using CUE.NET.Devices.Generic.Enums;
// ReSharper disable UnusedMemberInSuper.Global
// ReSharper disable UnusedMember.Global
using CUE.NET.Devices.Generic.Enums;
namespace CUE.NET.Devices
{
@@ -1,4 +1,5 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System.Linq;
using CUE.NET.Devices.Keyboard.Enums;
+4 -1
View File
@@ -1,4 +1,7 @@
using System.Collections.Generic;
// ReSharper disable UnusedMemberInSuper.Global
// ReSharper disable UnusedMember.Global
using System.Collections.Generic;
using CUE.NET.Brushes;
using CUE.NET.Devices.Generic;
+1
View File
@@ -1,4 +1,5 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System.Collections.Generic;
using CUE.NET.Devices.Keyboard.Enums;
@@ -1,5 +1,6 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
// ReSharper disable UnusedMember.Global
using System.Collections.Generic;
using System.Drawing;
-1
View File
@@ -2,7 +2,6 @@
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable UnusedMember.Global
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+1
View File
@@ -1,5 +1,6 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
// ReSharper disable UnusedMember.Global
using System;
using System.Drawing;
+4 -1
View File
@@ -1,4 +1,7 @@
using System.Collections.Generic;
// ReSharper disable UnusedMember.Global
// ReSharper disable UnusedMemberInSuper.Global
using System.Collections.Generic;
using CUE.NET.Brushes;
using CUE.NET.Devices.Generic;
+3 -1
View File
@@ -1,4 +1,6 @@
using System.Drawing;
// ReSharper disable UnusedMember.Global
using System.Drawing;
using System.Linq;
namespace CUE.NET.Gradients
+9 -5
View File
@@ -1,4 +1,8 @@
using System.Collections.Generic;
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedAutoPropertyAccessor.Global
// ReSharper disable UnusedMember.Global
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
@@ -10,17 +14,16 @@ namespace CUE.NET.Profiles
{
#region Properties & Fields
private Dictionary<string, CueProfileDevice> _devices;
public string Id { get; }
public string Name { get; }
private Dictionary<string, CueProfileDevice> _devices;
public IEnumerable<string> Modes
{
get
{
string device = _devices.Keys.FirstOrDefault();
CueProfileDevice cpd;
return (device != null && _devices.TryGetValue(device, out cpd)) ? cpd.Modes : new string[0];
}
@@ -66,7 +69,8 @@ namespace CUE.NET.Profiles
.ToDictionary(x => x.Name)
};
}
catch // I have no idea how the factory pattern should handle such a case - time to read :p
// ReSharper disable once CatchAllClause - I have no idea how the factory pattern should handle such a case - time to read :p
catch
{
return null;
}
+2 -1
View File
@@ -59,7 +59,8 @@ namespace CUE.NET.Profiles
.ToDictionary(x => x.Name)
};
}
catch // I have no idea how the factory pattern should handle such a case - time to read :p
// ReSharper disable once CatchAllClause - I have no idea how the factory pattern should handle such a case - time to read :p
catch
{
return null;
}
+2 -1
View File
@@ -63,7 +63,8 @@ namespace CUE.NET.Profiles
.ToDictionary(x => x.key, x => x.color)
};
}
catch (Exception ex) // I have no idea how the factory pattern should handle such a case - time to read :p
// ReSharper disable once CatchAllClause - I have no idea how the factory pattern should handle such a case - time to read :p
catch
{
return null;
}
+7 -3
View File
@@ -1,4 +1,6 @@
using System;
// ReSharper disable UnusedMember.Global
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -67,7 +69,8 @@ namespace CUE.NET.Profiles
{
return XDocument.Load(CONFIG_FILE).Root?.Elements("value").FirstOrDefault(x => string.Equals(x.Attribute("name")?.Value, "InitialProfile", StringComparison.OrdinalIgnoreCase))?.Value;
}
catch // This shouldn't happen but you never know ...
// ReSharper disable once CatchAllClause - This shouldn't happen but you never know ...
catch
{
return null;
}
@@ -90,7 +93,8 @@ namespace CUE.NET.Profiles
_profileNameMapping.Add(name, id);
}
}
catch // This shouldn't happen but you never know ...
// ReSharper disable once CatchAllClause - This shouldn't happen but you never know ...
catch
{
_profileNameMapping.Clear();
}