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
- SortAction.cs
- DispatcherObject.cs
- RenderCapability.cs
- DataMemberFieldEditor.cs
- AutomationPatternInfo.cs
- ComponentCache.cs
- TemplateColumn.cs
- XmlSchemaAttributeGroupRef.cs
- ObjectItemCachedAssemblyLoader.cs
- ClosableStream.cs
- XmlQueryOutput.cs
- HelpProvider.cs
- FormsIdentity.cs
- ToolStripInSituService.cs
- SecurityValidationBehavior.cs
- IconConverter.cs
- DataTableMappingCollection.cs
- Int32KeyFrameCollection.cs
- ContextMenuStripActionList.cs
- TextEndOfSegment.cs
- KeyValuePairs.cs
- DataServiceRequestOfT.cs
- NoClickablePointException.cs
- XmlAnyElementAttributes.cs
- SchemaCreator.cs
- SimpleWebHandlerParser.cs
- OperationResponse.cs
- WebPartVerbCollection.cs
- MailAddressCollection.cs
- VirtualizingPanel.cs
- DataGridViewToolTip.cs
- ServiceAuthorizationBehavior.cs
- NetWebProxyFinder.cs
- SiteMembershipCondition.cs
- TrustManager.cs
- BrowserTree.cs
- Point3DCollection.cs
- AddInSegmentDirectoryNotFoundException.cs
- DbgCompiler.cs
- Clock.cs
- IIS7WorkerRequest.cs
- PathGeometry.cs
- Registry.cs
- ErrorWrapper.cs
- TranslateTransform.cs
- _CookieModule.cs
- ServiceProviders.cs
- Triplet.cs
- StrongNameUtility.cs
- DiagnosticTrace.cs
- SQLRoleProvider.cs
- ContentFileHelper.cs
- ByteAnimationUsingKeyFrames.cs
- LockCookie.cs
- CollectionsUtil.cs
- PageSetupDialog.cs
- TextControlDesigner.cs
- BrushMappingModeValidation.cs
- DigitShape.cs
- keycontainerpermission.cs
- ReachSerializerAsync.cs
- TextSelection.cs
- MDIControlStrip.cs
- UniformGrid.cs
- BreakRecordTable.cs
- ClientUtils.cs
- DataGridViewCellValidatingEventArgs.cs
- OrderPreservingPipeliningSpoolingTask.cs
- PathSegment.cs
- SqlGatherProducedAliases.cs
- UpdateProgress.cs
- WizardPanelChangingEventArgs.cs
- UIElement3DAutomationPeer.cs
- ConfigurationLockCollection.cs
- HierarchicalDataBoundControlAdapter.cs
- GenerateScriptTypeAttribute.cs
- CacheEntry.cs
- VerificationAttribute.cs
- NameObjectCollectionBase.cs
- SymbolResolver.cs
- LicenseException.cs
- NotificationContext.cs
- ObjectDataSourceFilteringEventArgs.cs
- WindowsListViewItemCheckBox.cs
- BitmapData.cs
- ManagementException.cs
- SoapServerMessage.cs
- DrawingAttributes.cs
- FilteredDataSetHelper.cs
- ReflectPropertyDescriptor.cs
- ScriptRegistrationManager.cs
- XPathScanner.cs
- ToolStripControlHost.cs
- ToolBarPanel.cs
- OSEnvironmentHelper.cs
- RtType.cs
- CurrencyWrapper.cs
- ChannelRequirements.cs
- SizeFConverter.cs
- TextTreeExtractElementUndoUnit.cs