From 4f46a3ebdaf982b89fa877023480184c174231dd Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Thu, 16 Nov 2017 10:10:05 -0500 Subject: [PATCH] Tidying --- ICD.Common.Utils/AttributeUtils.cs | 8 ++++---- ICD.Common.Utils/Extensions/AssemblyExtensions.cs | 10 +++++----- ICD.Common.Utils/Extensions/TypeExtensions.cs | 2 +- ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs | 4 ++-- ICD.Common.Utils/PathUtils.cs | 3 +-- ICD.Common.Utils/ProcessorUtils.SimplSharp.cs | 1 + ICD.Common.Utils/ProgramUtils.SimplSharp.cs | 1 + ICD.Common.Utils/ThreadingUtils.cs | 6 +++--- ICD.Common.Utils/Xml/IcdXmlTextWriter.cs | 5 +++-- 9 files changed, 21 insertions(+), 19 deletions(-) diff --git a/ICD.Common.Utils/AttributeUtils.cs b/ICD.Common.Utils/AttributeUtils.cs index 79c0a4b..8067353 100644 --- a/ICD.Common.Utils/AttributeUtils.cs +++ b/ICD.Common.Utils/AttributeUtils.cs @@ -93,7 +93,7 @@ namespace ICD.Common.Utils { #if SIMPLSHARP Logger.AddEntry(eSeverity.Error, e, "{0} failed to cache assembly {1}", typeof(AttributeUtils).Name, - assembly.GetName().Name); + assembly.GetName().Name); #else Logger.AddEntry(eSeverity.Error, e, "{0} failed to cache assembly {1} - could not load type {2}", typeof(AttributeUtils).Name, assembly.GetName().Name, e.TypeName); @@ -166,9 +166,9 @@ namespace ICD.Common.Utils s_AttributeToMethodCache[attribute] = method; } -#endregion + #endregion -#region Lookup + #region Lookup /// /// Gets the first attribute on the given class type matching the generic type. @@ -244,6 +244,6 @@ namespace ICD.Common.Utils return s_AttributeToMethodCache[attribute]; } -#endregion + #endregion } } diff --git a/ICD.Common.Utils/Extensions/AssemblyExtensions.cs b/ICD.Common.Utils/Extensions/AssemblyExtensions.cs index 2d7d486..6e260da 100644 --- a/ICD.Common.Utils/Extensions/AssemblyExtensions.cs +++ b/ICD.Common.Utils/Extensions/AssemblyExtensions.cs @@ -1,16 +1,16 @@ using System; +using ICD.Common.Properties; +using ICD.Common.Utils.IO; #if SIMPLSHARP using Crestron.SimplSharp.Reflection; #else using System.Reflection; #endif -using ICD.Common.Properties; -using ICD.Common.Utils.IO; namespace ICD.Common.Utils.Extensions { - public static class AssemblyExtensions - { + public static class AssemblyExtensions + { /// /// Gets the path for the given assembly. Returns null if the assembly can not be found on disk. /// @@ -43,5 +43,5 @@ namespace ICD.Common.Utils.Extensions return IcdFile.Exists(path) ? path : null; } - } + } } diff --git a/ICD.Common.Utils/Extensions/TypeExtensions.cs b/ICD.Common.Utils/Extensions/TypeExtensions.cs index 7232685..72f5632 100644 --- a/ICD.Common.Utils/Extensions/TypeExtensions.cs +++ b/ICD.Common.Utils/Extensions/TypeExtensions.cs @@ -1,10 +1,10 @@ using System; +using System.Collections.Generic; #if SIMPLSHARP using Crestron.SimplSharp.Reflection; #else using System.Reflection; #endif -using System.Collections.Generic; namespace ICD.Common.Utils.Extensions { diff --git a/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs b/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs index 900b1ce..9f3e44a 100644 --- a/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs +++ b/ICD.Common.Utils/Json/AbstractGenericJsonConverter.cs @@ -12,7 +12,7 @@ namespace ICD.Common.Utils.Json /// The to write to. /// The value. /// The calling serializer. - public sealed override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + public override sealed void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { if (value == null) { @@ -42,7 +42,7 @@ namespace ICD.Common.Utils.Json /// /// The object value. /// - public sealed override object ReadJson(JsonReader reader, Type objectType, object existingValue, + public override sealed object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader.TokenType == JsonToken.Null) diff --git a/ICD.Common.Utils/PathUtils.cs b/ICD.Common.Utils/PathUtils.cs index 67b9ff9..f89dc93 100644 --- a/ICD.Common.Utils/PathUtils.cs +++ b/ICD.Common.Utils/PathUtils.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using ICD.Common.Properties; using ICD.Common.Utils.Extensions; diff --git a/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs b/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs index 2c98761..9ebd441 100644 --- a/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs +++ b/ICD.Common.Utils/ProcessorUtils.SimplSharp.cs @@ -189,4 +189,5 @@ namespace ICD.Common.Utils } } } + #endif diff --git a/ICD.Common.Utils/ProgramUtils.SimplSharp.cs b/ICD.Common.Utils/ProgramUtils.SimplSharp.cs index c86198d..639f5d2 100644 --- a/ICD.Common.Utils/ProgramUtils.SimplSharp.cs +++ b/ICD.Common.Utils/ProgramUtils.SimplSharp.cs @@ -125,4 +125,5 @@ namespace ICD.Common.Utils } } } + #endif diff --git a/ICD.Common.Utils/ThreadingUtils.cs b/ICD.Common.Utils/ThreadingUtils.cs index f42fe82..3416d35 100644 --- a/ICD.Common.Utils/ThreadingUtils.cs +++ b/ICD.Common.Utils/ThreadingUtils.cs @@ -1,12 +1,12 @@ using System; +using ICD.Common.Properties; +using ICD.Common.Services; +using ICD.Common.Services.Logging; #if SIMPLSHARP using Crestron.SimplSharp; #else using System.Threading.Tasks; #endif -using ICD.Common.Properties; -using ICD.Common.Services; -using ICD.Common.Services.Logging; namespace ICD.Common.Utils { diff --git a/ICD.Common.Utils/Xml/IcdXmlTextWriter.cs b/ICD.Common.Utils/Xml/IcdXmlTextWriter.cs index b5eaa37..3a1814d 100644 --- a/ICD.Common.Utils/Xml/IcdXmlTextWriter.cs +++ b/ICD.Common.Utils/Xml/IcdXmlTextWriter.cs @@ -3,6 +3,7 @@ using System.Text; using ICD.Common.Utils.IO; #if SIMPLSHARP using Crestron.SimplSharp.CrestronXml; + #else using System.Xml; #endif @@ -122,9 +123,9 @@ namespace ICD.Common.Utils.Xml m_Writer.WriteRaw(xml); } -#endregion + #endregion -#region Private Methods + #region Private Methods #if STANDARD private static XmlWriterSettings GetSettings(Encoding encoding)