From 0bfb7f225d431eaeec4226f7bd66e862b263f945 Mon Sep 17 00:00:00 2001 From: Krzysztof Morcinek Date: Thu, 18 Jan 2018 09:57:14 +0100 Subject: [PATCH] Revert "Merge pull request #19 from kmorcinek/master" This reverts commit 89575d3c900a4bd46ffd121ba83af216582572dc, reversing changes made to 8bb0ba45d45090d6b0d7f91082c14d0ab27ece47. --- .../ExcludeFromCodeCoverageAttribute.cs | 8 --- .../Extensions/TypeExtensions.cs | 13 ----- .../DesignByContractViolationException.cs | 10 ++++ Synergy.Contracts/Synergy.Contracts.csproj | 54 ++++++++++++++++--- Synergy.Contracts/packages.config | 4 ++ 5 files changed, 62 insertions(+), 27 deletions(-) delete mode 100644 Synergy.Contracts/ExcludeFromCodeCoverageAttribute.cs delete mode 100644 Synergy.Contracts/Extensions/TypeExtensions.cs create mode 100644 Synergy.Contracts/packages.config diff --git a/Synergy.Contracts/ExcludeFromCodeCoverageAttribute.cs b/Synergy.Contracts/ExcludeFromCodeCoverageAttribute.cs deleted file mode 100644 index ee35135..0000000 --- a/Synergy.Contracts/ExcludeFromCodeCoverageAttribute.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Diagnostics.CodeAnalysis -{ - /// Specifies that the attributed code should be excluded from code coverage information. - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Event, AllowMultiple = false, Inherited = false)] - public sealed class ExcludeFromCodeCoverageAttribute : Attribute - { - } -} diff --git a/Synergy.Contracts/Extensions/TypeExtensions.cs b/Synergy.Contracts/Extensions/TypeExtensions.cs deleted file mode 100644 index 73dce72..0000000 --- a/Synergy.Contracts/Extensions/TypeExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Reflection; - -namespace Synergy.Contracts.Extensions -{ - internal static class TypeExtensions - { - public static bool IsInstanceOfType(this Type type, object obj) - { - return obj != null && type.GetTypeInfo().IsAssignableFrom(obj.GetType().GetTypeInfo()); - } - } -} \ No newline at end of file diff --git a/Synergy.Contracts/Failures/DesignByContractViolationException.cs b/Synergy.Contracts/Failures/DesignByContractViolationException.cs index 8ca3c79..6e6ef8a 100644 --- a/Synergy.Contracts/Failures/DesignByContractViolationException.cs +++ b/Synergy.Contracts/Failures/DesignByContractViolationException.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics; +using System.Runtime.Serialization; using JetBrains.Annotations; namespace Synergy.Contracts @@ -8,6 +9,7 @@ namespace Synergy.Contracts /// The exception thrown when some contract check failed. /// When you see it it means that someone does not meet the contract. /// + [Serializable] [DebuggerStepThrough] public class DesignByContractViolationException : Exception { @@ -25,5 +27,13 @@ public DesignByContractViolationException() public DesignByContractViolationException([NotNull] string message) : base(message) { } + + /// + /// Serialization required constructor. + /// + protected DesignByContractViolationException([NotNull] SerializationInfo info, StreamingContext context) : + base(info, context) + { + } } } \ No newline at end of file diff --git a/Synergy.Contracts/Synergy.Contracts.csproj b/Synergy.Contracts/Synergy.Contracts.csproj index b3eca28..bc2932b 100644 --- a/Synergy.Contracts/Synergy.Contracts.csproj +++ b/Synergy.Contracts/Synergy.Contracts.csproj @@ -1,9 +1,16 @@ - + + + - netstandard1.0 - Synergy.Contracts + Debug + AnyCPU + {653FF172-0DC5-4D81-91AE-3CE09D8CF7C1} + Library + Properties Synergy.Contracts - false + Synergy.Contracts + v4.5.2 + 512 true @@ -28,7 +35,42 @@ true - - + + ..\packages\JetBrains.Annotations.10.2.1\lib\net\JetBrains.Annotations.dll + True + + + + + + + Properties\SynergyAssemblyInfo.cs + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Synergy.Contracts/packages.config b/Synergy.Contracts/packages.config new file mode 100644 index 0000000..b26fcb6 --- /dev/null +++ b/Synergy.Contracts/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file