Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ThrowHelper.cs
===================================================================
diff -u -r4000 -r4052
--- DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ThrowHelper.cs (.../ThrowHelper.cs) (revision 4000)
+++ DamEngine/trunk/src/Deltares.DamEngine.Data/Standard/ThrowHelper.cs (.../ThrowHelper.cs) (revision 4052)
@@ -21,42 +21,41 @@
using System;
-namespace Deltares.DamEngine.Data.Standard
+namespace Deltares.DamEngine.Data.Standard;
+
+///
+/// Helper class for generating excepions
+///
+public class ThrowHelper
{
///
- /// Helper class for generating excepions
+ /// Throws the when condition is true.
///
- public class ThrowHelper
+ /// The type of the exception.
+ /// The message.
+ /// The condition.
+ public static void ThrowWhenConditionIsTrue(string message, Func condition)
+ where TException : Exception
{
- ///
- /// Throws the when condition is true.
- ///
- /// The type of the exception.
- /// The message.
- /// The condition.
- public static void ThrowWhenConditionIsTrue(string message, Func condition)
- where TException : Exception
- {
- var exception = (Exception) Activator.CreateInstance(typeof(TException), message);
+ var exception = (Exception) Activator.CreateInstance(typeof(TException), message);
- if (condition())
- {
- throw exception;
- }
+ if (condition())
+ {
+ throw exception;
}
+ }
- ///
- /// Throws if argument null.
- ///
- /// The value.
- /// The message.
- ///
- public static void ThrowIfArgumentNull(object value, string message)
+ ///
+ /// Throws if argument null.
+ ///
+ /// The value.
+ /// The message.
+ ///
+ public static void ThrowIfArgumentNull(object value, string message)
+ {
+ if (value == null)
{
- if (value == null)
- {
- throw new ArgumentNullException(message);
- }
+ throw new ArgumentNullException(message);
}
}
}
\ No newline at end of file