diff --git a/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj b/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj
index 4a0b1be..743f684 100644
--- a/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj
+++ b/src/CodeProject.ObjectPool/CodeProject.ObjectPool.csproj
@@ -33,22 +33,27 @@
-
-
-
-
$(DefineConstants);NETSTD10;LIBLOG_PORTABLE
$(PackageTargetFallback);dnxcore50
+
+
+
+
$(DefineConstants);NETSTD13;LIBLOG_PORTABLE
$(PackageTargetFallback);dnxcore50
+
+
+
+
+
- $(DefineConstants);NET35
+ $(DefineConstants);NET35;HAS_SERIALIZABLE
@@ -56,7 +61,7 @@
- $(DefineConstants);NET40
+ $(DefineConstants);NET40;HAS_SERIALIZABLE
@@ -65,7 +70,7 @@
- $(DefineConstants);NET45
+ $(DefineConstants);NET45;HAS_SERIALIZABLE
diff --git a/src/CodeProject.ObjectPool/ParameterizedObjectPool.cs b/src/CodeProject.ObjectPool/ParameterizedObjectPool.cs
index 925f796..abb54b7 100644
--- a/src/CodeProject.ObjectPool/ParameterizedObjectPool.cs
+++ b/src/CodeProject.ObjectPool/ParameterizedObjectPool.cs
@@ -9,7 +9,6 @@
*/
using CodeProject.ObjectPool.Core;
-using PommaLabs.Thrower;
using System;
using System.Diagnostics;
using System.Linq;
@@ -69,7 +68,7 @@ public int MaximumPoolSize
set
{
// Preconditions
- Raise.ArgumentOutOfRangeException.If(value < 1, nameof(value), ErrorMessages.NegativeOrZeroMaximumPoolSize);
+ if (value < 1) throw new ArgumentOutOfRangeException(nameof(value), ErrorMessages.NegativeOrZeroMaximumPoolSize);
_maximumPoolSize = value;
}
@@ -123,7 +122,7 @@ public ParameterizedObjectPool(Func factoryMethod)
public ParameterizedObjectPool(int maximumPoolSize, Func factoryMethod)
{
// Preconditions
- Raise.ArgumentOutOfRangeException.If(maximumPoolSize < 1, nameof(maximumPoolSize), ErrorMessages.NegativeOrZeroMaximumPoolSize);
+ if (maximumPoolSize < 1) throw new ArgumentOutOfRangeException(nameof(maximumPoolSize), ErrorMessages.NegativeOrZeroMaximumPoolSize);
// Assigning properties
Diagnostics = new ObjectPoolDiagnostics();
diff --git a/src/CodeProject.ObjectPool/PooledObject.cs b/src/CodeProject.ObjectPool/PooledObject.cs
index 1ceb2b4..b0d57b3 100644
--- a/src/CodeProject.ObjectPool/PooledObject.cs
+++ b/src/CodeProject.ObjectPool/PooledObject.cs
@@ -9,13 +9,12 @@
*/
using CodeProject.ObjectPool.Core;
-using PommaLabs.Thrower.Goodies;
using System;
using System.Collections.Generic;
#if !NET35
-using PommaLabs.Thrower.Logging;
+using CodeProject.ObjectPool.Logging;
#endif
@@ -24,8 +23,11 @@ namespace CodeProject.ObjectPool
///
/// PooledObject base class.
///
+#if HAS_SERIALIZABLE
[Serializable]
- public abstract class PooledObject : EquatableObject, IDisposable
+#endif
+
+ public abstract class PooledObject : IDisposable, IEquatable
{
#region Logging
@@ -190,34 +192,39 @@ private void HandleReAddingToPool(bool reRegisterForFinalization)
#region Formatting and equality
- ///
- /// Returns all property (or field) values, along with their names, so that they can be
- /// used to produce a meaningful .
- ///
- ///
- /// All property (or field) values, along with their names, so that they can be used to
- /// produce a meaningful .
- ///
- protected override IEnumerable> GetFormattingMembers()
- {
- yield return new KeyValuePair(nameof(PooledObjectInfo.Id), PooledObjectInfo.Id);
- if (PooledObjectInfo.Payload != null)
- {
- yield return new KeyValuePair(nameof(PooledObjectInfo.Payload), PooledObjectInfo.Payload);
- }
- }
-
- ///
- /// Returns all property (or field) values that should be used inside
- /// or .
- ///
- ///
- /// All property (or field) values that should be used inside
- /// or .
- ///
- protected override IEnumerable