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
- HwndAppCommandInputProvider.cs
- HttpCacheParams.cs
- UIAgentCrashedException.cs
- SpellerHighlightLayer.cs
- DataGridViewCell.cs
- IsolatedStorage.cs
- ExplicitDiscriminatorMap.cs
- XamlDesignerSerializationManager.cs
- CapacityStreamGeometryContext.cs
- SimplePropertyEntry.cs
- ErrorLog.cs
- TextLineResult.cs
- StringUtil.cs
- SqlBuffer.cs
- MinMaxParagraphWidth.cs
- SafeMemoryMappedViewHandle.cs
- MsmqTransportElement.cs
- GridViewDeleteEventArgs.cs
- ActionFrame.cs
- DataServiceClientException.cs
- Attributes.cs
- TraceUtils.cs
- DataBinder.cs
- NetDataContractSerializer.cs
- CultureSpecificCharacterBufferRange.cs
- MultiPartWriter.cs
- IdnElement.cs
- Configuration.cs
- AccessedThroughPropertyAttribute.cs
- DataGridViewAdvancedBorderStyle.cs
- SmiTypedGetterSetter.cs
- AspProxy.cs
- WhileDesigner.cs
- UnsafeMethods.cs
- UpdatePanelTrigger.cs
- SecurityResources.cs
- PreviousTrackingServiceAttribute.cs
- RelAssertionDirectKeyIdentifierClause.cs
- Wizard.cs
- DocumentReferenceCollection.cs
- BitHelper.cs
- FormatException.cs
- ComplexBindingPropertiesAttribute.cs
- UnmanagedMarshal.cs
- WorkflowOwnershipException.cs
- QilFactory.cs
- MetadataCacheItem.cs
- InputLanguageCollection.cs
- ParsedAttributeCollection.cs
- ExpressionBuilderCollection.cs
- SqlBuilder.cs
- TraceListener.cs
- StaticSiteMapProvider.cs
- HtmlInputButton.cs
- WinInet.cs
- TreeWalkHelper.cs
- OracleException.cs
- _HeaderInfo.cs
- MsmqInputChannelListener.cs
- ValueConversionAttribute.cs
- ZoneButton.cs
- PartialClassGenerationTaskInternal.cs
- InternalControlCollection.cs
- StateFinalizationDesigner.cs
- RotationValidation.cs
- XmlComment.cs
- ConfigXmlComment.cs
- WorkflowIdleBehavior.cs
- CompilationUtil.cs
- MenuTracker.cs
- IssuanceTokenProviderState.cs
- HtmlInputCheckBox.cs
- OracleDataReader.cs
- CharUnicodeInfo.cs
- RegisteredArrayDeclaration.cs
- GridErrorDlg.cs
- ToolStripItem.cs
- WindowsScrollBar.cs
- XmlQualifiedName.cs
- Panel.cs
- KerberosSecurityTokenAuthenticator.cs
- TextBoxAutoCompleteSourceConverter.cs
- querybuilder.cs
- InputLanguage.cs
- FlowDocumentPaginator.cs
- FixedLineResult.cs
- UInt32.cs
- GC.cs
- ValidationErrorEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- BitmapSource.cs
- TdsParserSessionPool.cs
- MsmqOutputSessionChannel.cs
- KeyedQueue.cs
- EntityWrapperFactory.cs
- HintTextMaxWidthConverter.cs
- Operator.cs
- GlyphingCache.cs
- BrowserInteropHelper.cs
- Propagator.JoinPropagator.cs