diff --git a/src/SenseNet.Tools.Tests/Properties/AssemblyInfo.cs b/src/SenseNet.Tools.Tests/Properties/AssemblyInfo.cs index 7d958b2..8b45a8b 100644 --- a/src/SenseNet.Tools.Tests/Properties/AssemblyInfo.cs +++ b/src/SenseNet.Tools.Tests/Properties/AssemblyInfo.cs @@ -2,9 +2,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. [assembly: AssemblyTitle("SenseNet.Tools.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] @@ -14,23 +11,9 @@ [assembly: AssemblyTrademark("Sense/Net Inc.")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("ec7fc58f-81cc-411b-92e0-079b7c39d0a5")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.1.0")] -[assembly: AssemblyFileVersion("2.0.1.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] +[assembly: AssemblyInformationalVersion("2.1.1")] diff --git a/src/SenseNet.Tools/Configuration/SnConfig.cs b/src/SenseNet.Tools/Configuration/SnConfig.cs index 4b91409..584d59d 100644 --- a/src/SenseNet.Tools/Configuration/SnConfig.cs +++ b/src/SenseNet.Tools/Configuration/SnConfig.cs @@ -12,6 +12,15 @@ namespace SenseNet.Configuration /// public abstract class SnConfig { + /// + /// Initializes an instance of the SnConfig class. + /// + protected SnConfig() + { + // This technical constructor was created to prevent external code from + // instantiating this utility class using the default public constructor. + } + //============================================================================== Properties /// diff --git a/src/SenseNet.Tools/Diagnostics/Analysis/FileReader.cs b/src/SenseNet.Tools/Diagnostics/Analysis/FileReader.cs index 71bf924..2087a0c 100644 --- a/src/SenseNet.Tools/Diagnostics/Analysis/FileReader.cs +++ b/src/SenseNet.Tools/Diagnostics/Analysis/FileReader.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; #pragma warning disable 1591 @@ -30,13 +29,10 @@ public override IEnumerator GetEnumerator() protected override void Dispose(bool disposing) { - IDisposable disposable; if (!disposing) return; - if (_reader == null) - return; - if ((disposable = _reader as IDisposable) != null) - disposable.Dispose(); + + _reader?.Dispose(); } } } diff --git a/src/SenseNet.Tools/Diagnostics/SnTrace.cs b/src/SenseNet.Tools/Diagnostics/SnTrace.cs index 79830b2..a76cdb2 100644 --- a/src/SenseNet.Tools/Diagnostics/SnTrace.cs +++ b/src/SenseNet.Tools/Diagnostics/SnTrace.cs @@ -80,7 +80,7 @@ public class Operation : IDisposable { private static long _nextId = 1; - internal static Operation Null = new Operation(0L); + internal static readonly Operation Null = new Operation(0L); /// /// Gets the operation identifier that is unique in the current AppDomain. diff --git a/src/SenseNet.Tools/Properties/AssemblyInfo.cs b/src/SenseNet.Tools/Properties/AssemblyInfo.cs index 3ae7d4c..f2f0602 100644 --- a/src/SenseNet.Tools/Properties/AssemblyInfo.cs +++ b/src/SenseNet.Tools/Properties/AssemblyInfo.cs @@ -2,9 +2,6 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. [assembly: AssemblyTitle("SenseNet.Tools")] [assembly: AssemblyDescription("Tools library for Sense/Net ECM")] [assembly: AssemblyConfiguration("")] @@ -14,26 +11,11 @@ [assembly: AssemblyTrademark("Sense/Net Inc.")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9c2fa8d5-65f8-4cad-a65d-b7cc804a821f")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("2.1.1.0")] [assembly: AssemblyFileVersion("2.1.1.0")] -[assembly: AssemblyInformationalVersion("2.1.1-alpha")] +[assembly: AssemblyInformationalVersion("2.1.1")] [assembly: InternalsVisibleTo("SenseNet.Tools.Tests")] diff --git a/src/SenseNet.Tools/SenseNet.Tools.nuspec b/src/SenseNet.Tools/SenseNet.Tools.nuspec index b35654e..4274eef 100644 --- a/src/SenseNet.Tools/SenseNet.Tools.nuspec +++ b/src/SenseNet.Tools/SenseNet.Tools.nuspec @@ -1,18 +1,18 @@ - + SenseNet.Tools $version$ - SenseNet Tools for .Net + Sense/Net Tools for .Net tusmester,kavics Sense/Net https://github.com/SenseNet/sn-tools/blob/master/LICENSE https://github.com/SenseNet/sn-tools - https://avatars2.githubusercontent.com/u/4069121?v=3&s=200 + https://raw.githubusercontent.com/SenseNet/sn-resources/master/images/sn-icon/sensenet-icon-64.png false - General .Net tools that can be used even in projects independent from SenseNet ECM. + General .Net tools that can be used even in projects independent from Sense/Net ECM. Copyright © Sense/Net Inc. en-US sensenet tools - \ No newline at end of file + diff --git a/src/SenseNet.Tools/Tools/Extensions.cs b/src/SenseNet.Tools/Tools/Extensions.cs index 2b8ad34..b4af4eb 100644 --- a/src/SenseNet.Tools/Tools/Extensions.cs +++ b/src/SenseNet.Tools/Tools/Extensions.cs @@ -28,7 +28,7 @@ public static Task ForEachAsync(this IEnumerable source, int degreeOfParal { using (partition) while (partition.MoveNext()) - await action(partition.Current); + await action(partition.Current).ConfigureAwait(false); }))); } } diff --git a/src/SenseNet.Tools/Tools/Retrier.cs b/src/SenseNet.Tools/Tools/Retrier.cs index d8432fb..ff6a5cc 100644 --- a/src/SenseNet.Tools/Tools/Retrier.cs +++ b/src/SenseNet.Tools/Tools/Retrier.cs @@ -8,7 +8,7 @@ namespace SenseNet.Tools /// the maximum number of retry attempts, the callback that should be /// called and the exception type that should be suppressed. /// - public class Retrier + public static class Retrier { /// /// Calls the callback method safely. If the given type of exception is caught, @@ -204,7 +204,7 @@ public static async Task RetryAsync(int count, int waitMilliseconds, Func< try { - result = await callback(); + result = await callback().ConfigureAwait(false); } catch (Exception e) { @@ -247,7 +247,7 @@ public static async Task RetryAsync(int count, int waitMilliseconds, Func try { - await callback(); + await callback().ConfigureAwait(false); } catch (Exception e) { diff --git a/src/SenseNet.Tools/Tools/TypeResolver.cs b/src/SenseNet.Tools/Tools/TypeResolver.cs index a0f74d5..8bd9fe9 100644 --- a/src/SenseNet.Tools/Tools/TypeResolver.cs +++ b/src/SenseNet.Tools/Tools/TypeResolver.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Linq; using System.Reflection; @@ -114,10 +115,10 @@ public static Type FindTypeInAppDomain(string typeName, bool throwOnError = true { var split = typeName.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); var tname = split[0]; - var asmName = split.Length > 1 ? split[1].ToLower().Trim() : null; + var asmName = split.Length > 1 ? split[1].ToLower(CultureInfo.InvariantCulture).Trim() : null; foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) { - if (asmName != null && asmName != assembly.GetName().Name.ToLower()) + if (asmName != null && asmName != assembly.GetName().Name.ToLower(CultureInfo.InvariantCulture)) continue; try {