- nantgenie-12305.zip
- Agile
- Agile.Common
- Components
- nunit.framework.dll
- Silverlight
- Blacklight.Silverlight.Controls.dll
- Unity
- Wintellect
- Wintellect.Threading.CompactFx.dll
- Wintellect.Threading.CompactFx.pdb
- Wintellect.Threading.CompactFx.XML
- Wintellect.Threading.dll
- Wintellect.Threading.pdb
- Wintellect.Threading.Silverlight.dll
- Wintellect.Threading.Silverlight.pdb
- Wintellect.Threading.Silverlight.XML
- Wintellect.Threading.XML
- Descriptors
- Descriptors
- GeneratorDetails
- Generators
- Generator.Tests
- Generators
- NantGenie.sln
- NantGenie
|
using System;
namespace Agile.Common
{
/// <summary>
/// Implemented methods that disappeared from enterprise lib in V2.0
/// </summary>
public sealed class ArgumentValidation
{
/// <summary>
/// Checks the variable is not null, throws an exception if it is
/// </summary>
/// <param name="variable">the object</param>
/// <param name="variableName">name of the variable</param>
public static void CheckForNullReference(object variable, string variableName)
{
if (variable == null)
throw new ArgumentNullException(string.Format("{0} is required but was null", variableName));
}
/// <summary>
/// Checks the variable is not empty, throws an exception if it is
/// </summary>
/// <param name="variable">the object</param>
/// <param name="variableName">name of the variable</param>
public static void CheckForEmptyString(string variable, string variableName)
{
CheckForNullReference(variable, variableName);
CheckForNullReference(variableName, "variableName");
if (variable.Length == 0)
{
throw new ArgumentException(string.Format("{0} is required but was empty", variableName));
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I live in Sydney and have been a developer for almost a decade now. I have a passion for technology and a strong interest in discovering 'better, cleaner, faster' ways to get systems out the door because I believe software development takes too long. If I have an idea I want to realise it as quickly as possible...plus writing systems for someone else I want to deliver quickly so I can move onto the next interesting project!