1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 16:58:29 +00:00

Refactoring

This commit is contained in:
Darth Affe 2016-02-07 10:06:07 +01:00
parent 0b6ba617ac
commit 089cada426
21 changed files with 58 additions and 19 deletions

View File

@ -1,4 +1,6 @@
using System.Drawing;
// ReSharper disable VirtualMemberNeverOverriden.Global
using System.Drawing;
using CUE.NET.Helper;
namespace CUE.NET.Brushes

View File

@ -1,3 +1,5 @@
// ReSharper disable UnusedMemberInSuper.Global
using System.Drawing;
namespace CUE.NET.Brushes

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;

View File

@ -1,5 +1,6 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
// ReSharper disable UnusedMember.Global
using System;
using System.Drawing;

View File

@ -1,4 +1,6 @@
using System;
// ReSharper disable UnusedMember.Global
using System;
using System.Drawing;
using CUE.NET.Helper;

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;

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;

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

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
{

View File

@ -1,4 +1,5 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System.Linq;
using CUE.NET.Devices.Keyboard.Enums;

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;

View File

@ -1,4 +1,5 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable UnusedMember.Global
using System.Collections.Generic;
using CUE.NET.Devices.Keyboard.Enums;

View File

@ -1,5 +1,6 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
// ReSharper disable UnusedMember.Global
using System.Collections.Generic;
using System.Drawing;

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;

View File

@ -1,5 +1,6 @@
// ReSharper disable MemberCanBePrivate.Global
// ReSharper disable AutoPropertyCanBeMadeGetOnly.Global
// ReSharper disable UnusedMember.Global
using System;
using System.Drawing;

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;

View File

@ -1,4 +1,6 @@
using System.Drawing;
// ReSharper disable UnusedMember.Global
using System.Drawing;
using System.Linq;
namespace CUE.NET.Gradients

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;
}

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;
}

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;
}

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();
}