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
- DecodeHelper.cs
- Message.cs
- FloaterBaseParagraph.cs
- StaticTextPointer.cs
- LogArchiveSnapshot.cs
- WrappedIUnknown.cs
- ComponentResourceKey.cs
- PathSegmentCollection.cs
- XmlDocumentSerializer.cs
- HyperLinkStyle.cs
- Misc.cs
- ViewStateException.cs
- SecurityPolicyVersion.cs
- DbConnectionHelper.cs
- RotateTransform.cs
- MultiTrigger.cs
- DetailsViewInsertEventArgs.cs
- HtmlButton.cs
- EditingCoordinator.cs
- OutOfProcStateClientManager.cs
- SafeProcessHandle.cs
- Model3D.cs
- processwaithandle.cs
- Connection.cs
- ClientApiGenerator.cs
- CodeTypeMember.cs
- ProtectedConfigurationSection.cs
- AccessibleObject.cs
- InvokeSchedule.cs
- UriGenerator.cs
- DesignTimeVisibleAttribute.cs
- XmlObjectSerializerWriteContextComplex.cs
- XamlParser.cs
- MimeReturn.cs
- SecurityResources.cs
- Double.cs
- SqlInfoMessageEvent.cs
- RadioButtonList.cs
- ChtmlLinkAdapter.cs
- ClientTargetCollection.cs
- SQLInt64.cs
- SqlGatherConsumedAliases.cs
- ContentControl.cs
- METAHEADER.cs
- ThreadPool.cs
- SizeKeyFrameCollection.cs
- CodeChecksumPragma.cs
- OleDbErrorCollection.cs
- ParallelTimeline.cs
- RegexCaptureCollection.cs
- DataQuery.cs
- EmptyCollection.cs
- CheckBoxRenderer.cs
- TabControlCancelEvent.cs
- ProfileInfo.cs
- _NetRes.cs
- DataServiceExpressionVisitor.cs
- RectIndependentAnimationStorage.cs
- RepeatInfo.cs
- ToolStripContainerDesigner.cs
- SafeNativeMethodsCLR.cs
- KnownBoxes.cs
- ReadContentAsBinaryHelper.cs
- ObjectDataSourceEventArgs.cs
- ColumnResizeAdorner.cs
- ReadWriteControlDesigner.cs
- WmpBitmapDecoder.cs
- Matrix3DValueSerializer.cs
- KnownBoxes.cs
- ExclusiveTcpListener.cs
- MobileListItem.cs
- WarningException.cs
- WebPartHelpVerb.cs
- SchemaImporterExtensionElement.cs
- PropertySourceInfo.cs
- WebPartUtil.cs
- ValidatorCollection.cs
- TailPinnedEventArgs.cs
- ReaderWriterLock.cs
- FormViewUpdatedEventArgs.cs
- EmptyEnumerator.cs
- DataGridLinkButton.cs
- FileClassifier.cs
- Scheduling.cs
- ToolStripSeparator.cs
- InProcStateClientManager.cs
- DataSourceControlBuilder.cs
- RtfToXamlLexer.cs
- BitVector32.cs
- BooleanFunctions.cs
- CodeActivityContext.cs
- COSERVERINFO.cs
- XamlDesignerSerializationManager.cs
- ReachSerializerAsync.cs
- Quaternion.cs
- SafeHGlobalHandleCritical.cs
- StatusBarPanelClickEvent.cs
- DataSourceCacheDurationConverter.cs
- ConstrainedDataObject.cs
- SessionState.cs