Code:
/ 4.0 / 4.0 / 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. //------------------------------------------------------------------------------ // // 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
- InvokeHandlers.cs
- Parallel.cs
- HttpConfigurationSystem.cs
- ISAPIApplicationHost.cs
- DefaultBinder.cs
- ContainerCodeDomSerializer.cs
- ListViewHitTestInfo.cs
- FixedSchema.cs
- ResourceBinder.cs
- DrawingContext.cs
- GridViewEditEventArgs.cs
- StylusButtonCollection.cs
- UpdateManifestForBrowserApplication.cs
- MethodExecutor.cs
- SchemaCollectionPreprocessor.cs
- XamlSerializer.cs
- ContainerVisual.cs
- ControlCachePolicy.cs
- IntSecurity.cs
- DataControlField.cs
- LocatorManager.cs
- AppearanceEditorPart.cs
- Rotation3DAnimationBase.cs
- filewebrequest.cs
- ToolStripProgressBar.cs
- ReadOnlyActivityGlyph.cs
- UIServiceHelper.cs
- HttpContextServiceHost.cs
- Tuple.cs
- PriorityQueue.cs
- TreeNodeBindingCollection.cs
- StagingAreaInputItem.cs
- TCPClient.cs
- GroupBoxAutomationPeer.cs
- VirtualPathProvider.cs
- Error.cs
- X509InitiatorCertificateClientElement.cs
- LocalBuilder.cs
- SingletonChannelAcceptor.cs
- FilterException.cs
- SettingsPropertyIsReadOnlyException.cs
- Delegate.cs
- DataColumnMappingCollection.cs
- RepeatButton.cs
- IsolatedStoragePermission.cs
- ControlCachePolicy.cs
- WmlObjectListAdapter.cs
- SqlInternalConnectionSmi.cs
- CustomWebEventKey.cs
- LayoutSettings.cs
- PngBitmapDecoder.cs
- CodeBinaryOperatorExpression.cs
- TypeInitializationException.cs
- DetectEofStream.cs
- UnitySerializationHolder.cs
- EventDrivenDesigner.cs
- XmlExpressionDumper.cs
- DrawingContextWalker.cs
- PrePostDescendentsWalker.cs
- SendMailErrorEventArgs.cs
- ExpressionVisitor.cs
- ProfileParameter.cs
- UIServiceHelper.cs
- QueryAccessibilityHelpEvent.cs
- OdbcStatementHandle.cs
- TextSelectionHighlightLayer.cs
- ObjectDataSourceChooseTypePanel.cs
- BooleanExpr.cs
- EntityViewContainer.cs
- BidOverLoads.cs
- DropShadowEffect.cs
- DataFormats.cs
- XsltContext.cs
- CompositeControl.cs
- ArgumentFixer.cs
- DetailsViewAutoFormat.cs
- BitStream.cs
- DataSourceHelper.cs
- SafeCryptoHandles.cs
- GetPageNumberCompletedEventArgs.cs
- CodeAccessSecurityEngine.cs
- SystemParameters.cs
- CqlWriter.cs
- ScrollContentPresenter.cs
- StandardOleMarshalObject.cs
- SAPICategories.cs
- WorkflowServiceAttributes.cs
- GetReadStreamResult.cs
- EventWaitHandle.cs
- RequestQueryParser.cs
- WsatAdminException.cs
- Transform3D.cs
- WebSysDefaultValueAttribute.cs
- TextTreePropertyUndoUnit.cs
- FloatSumAggregationOperator.cs
- MiniModule.cs
- OSFeature.cs
- DropShadowBitmapEffect.cs
- SQLInt32.cs
- UserThread.cs