Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Design / system / Data / Entity / Design / Common / EDesignUtil.cs / 1305376 / EDesignUtil.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// @owner [....]
// @backupOwner [....]
//-----------------------------------------------------------------------------
namespace System.Data.Services.Design.Common {
using System;
internal static class EDesignUtil
{
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
//
// Helper Functions
//
static internal T CheckArgumentNull(T value, string parameterName) where T : class
{
if (null == value)
{
throw Error.ArgumentNull(parameterName);
}
return value;
}
static internal void CheckStringArgument(string value, string parameterName)
{
// Throw ArgumentNullException when string is null
CheckArgumentNull(value, parameterName);
// Throw ArgumentException when string is empty
if (value.Length == 0)
{
throw InvalidStringArgument(parameterName);
}
}
static internal LanguageOption CheckLanguageOptionArgument(LanguageOption value, string paramName)
{
if (value == LanguageOption.GenerateCSharpCode ||
value == LanguageOption.GenerateVBCode)
{
return value;
}
throw Error.ArgumentOutOfRange(paramName);
}
static internal DataServiceCodeVersion CheckDataServiceCodeVersionArgument(DataServiceCodeVersion value, string paramName)
{
if (value == DataServiceCodeVersion.V1 ||
value == DataServiceCodeVersion.V2)
{
return value;
}
throw Error.ArgumentOutOfRange(paramName);
}
static internal ArgumentException InvalidStringArgument(string parameterName) {
ArgumentException e = new ArgumentException(Strings.InvalidStringArgument(parameterName));
return e;
}
static internal InvalidOperationException InvalidOperation(string error)
{
InvalidOperationException e = new InvalidOperationException(error);
return e;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ContextInformation.cs
- QueryExtender.cs
- MediaScriptCommandRoutedEventArgs.cs
- GPStream.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- BStrWrapper.cs
- ByteStreamGeometryContext.cs
- HtmlTableRow.cs
- ResolveCriteriaApril2005.cs
- DataKey.cs
- InstanceKeyNotReadyException.cs
- EntityCollection.cs
- RelatedImageListAttribute.cs
- FlowDocumentPaginator.cs
- DataGridViewRowPostPaintEventArgs.cs
- SerializationAttributes.cs
- MetafileHeaderEmf.cs
- MetafileHeaderEmf.cs
- Image.cs
- SHA1Managed.cs
- DrawToolTipEventArgs.cs
- bidPrivateBase.cs
- Unit.cs
- ListenerConnectionModeReader.cs
- DiscoveryExceptionDictionary.cs
- XmlWriter.cs
- RewritingValidator.cs
- BinaryMessageEncodingBindingElement.cs
- IndentedTextWriter.cs
- FixUp.cs
- ObjectDataSourceFilteringEventArgs.cs
- PersonalizationEntry.cs
- DataServiceRequestArgs.cs
- HtmlUtf8RawTextWriter.cs
- CqlLexer.cs
- IRCollection.cs
- _SslStream.cs
- XPathNavigator.cs
- MetadataHelper.cs
- ChangesetResponse.cs
- Baml2006KnownTypes.cs
- httpstaticobjectscollection.cs
- ControlBuilderAttribute.cs
- HttpInputStream.cs
- Knowncolors.cs
- GridItemPattern.cs
- HttpTransportSecurity.cs
- NativeMethodsCLR.cs
- TryExpression.cs
- StandardToolWindows.cs
- COM2ExtendedTypeConverter.cs
- WebServiceClientProxyGenerator.cs
- WebPartDeleteVerb.cs
- EUCJPEncoding.cs
- VideoDrawing.cs
- TemplateBuilder.cs
- DocumentViewerBaseAutomationPeer.cs
- SqlRemoveConstantOrderBy.cs
- RunInstallerAttribute.cs
- FlowDecision.cs
- CultureInfoConverter.cs
- ZipIOLocalFileHeader.cs
- SQLDoubleStorage.cs
- WebPartsPersonalization.cs
- ValueType.cs
- InputManager.cs
- LinearKeyFrames.cs
- BaseTemplateBuildProvider.cs
- XmlArrayItemAttributes.cs
- Triplet.cs
- ClientBuildManagerCallback.cs
- SqlClientMetaDataCollectionNames.cs
- SchemaNames.cs
- RSAPKCS1SignatureFormatter.cs
- RuntimeResourceSet.cs
- ChtmlTextWriter.cs
- ComNativeDescriptor.cs
- MetadataArtifactLoaderComposite.cs
- COM2IProvidePropertyBuilderHandler.cs
- WebPartDisplayModeEventArgs.cs
- WmlImageAdapter.cs
- MarshalByValueComponent.cs
- CollectionBase.cs
- EdmScalarPropertyAttribute.cs
- SqlCachedBuffer.cs
- AttributedMetaModel.cs
- TdsEnums.cs
- PropertyChange.cs
- AudioFileOut.cs
- StructuredTypeInfo.cs
- printdlgexmarshaler.cs
- ByteAnimationUsingKeyFrames.cs
- ServiceModelConfigurationSectionCollection.cs
- GenericPrincipal.cs
- UrlPath.cs
- FrameworkObject.cs
- Exceptions.cs
- WmpBitmapEncoder.cs
- SmiGettersStream.cs
- XmlSchemaSimpleContentExtension.cs