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
- ControlParser.cs
- TextElementEditingBehaviorAttribute.cs
- SingleSelectRootGridEntry.cs
- DesignerDataTableBase.cs
- PeerPresenceInfo.cs
- PassportIdentity.cs
- LongValidator.cs
- DataContractJsonSerializerOperationFormatter.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- PathFigureCollectionValueSerializer.cs
- DesignerOptions.cs
- TypeForwardedToAttribute.cs
- ExpressionSelection.cs
- ThreadStaticAttribute.cs
- LowerCaseStringConverter.cs
- TypeExtensionSerializer.cs
- RichListBox.cs
- HtmlTableCell.cs
- RuleElement.cs
- ResponseBodyWriter.cs
- JsonCollectionDataContract.cs
- DeferredRunTextReference.cs
- EditorPart.cs
- BitmapEffectGroup.cs
- Version.cs
- Set.cs
- AppearanceEditorPart.cs
- TrackingMemoryStream.cs
- UnsafeNativeMethodsCLR.cs
- TypeViewSchema.cs
- SchemaComplexType.cs
- PixelShader.cs
- DiagnosticTrace.cs
- ArithmeticException.cs
- VirtualPathUtility.cs
- WebPartEditVerb.cs
- Size.cs
- WmpBitmapEncoder.cs
- HMACSHA256.cs
- XmlDataSourceView.cs
- DaylightTime.cs
- XslException.cs
- StreamUpgradeProvider.cs
- XmlConvert.cs
- RequestCache.cs
- FirstMatchCodeGroup.cs
- UmAlQuraCalendar.cs
- DataServiceHostFactory.cs
- CopyNamespacesAction.cs
- MexNamedPipeBindingElement.cs
- ClientSponsor.cs
- UIPermission.cs
- TreeNodeStyleCollection.cs
- DeflateStream.cs
- DataRecordInternal.cs
- SettingsAttributes.cs
- XamlWriter.cs
- KeyboardDevice.cs
- DoWhile.cs
- CheckPair.cs
- LiteralText.cs
- SizeLimitedCache.cs
- Keywords.cs
- EntityTypeEmitter.cs
- Pair.cs
- ETagAttribute.cs
- StrokeNodeOperations.cs
- EffectiveValueEntry.cs
- TdsValueSetter.cs
- WebPartsSection.cs
- CompiledQuery.cs
- ParameterBuilder.cs
- EntityDataSourceSelectingEventArgs.cs
- TranslateTransform.cs
- IndexExpression.cs
- RedirectionProxy.cs
- ResolvedKeyFrameEntry.cs
- AutomationPatternInfo.cs
- LinearGradientBrush.cs
- Claim.cs
- DetailsViewAutoFormat.cs
- ValueExpressions.cs
- MenuItemStyleCollectionEditor.cs
- Vector3DValueSerializer.cs
- BrushValueSerializer.cs
- UIntPtr.cs
- SiteMapNodeItem.cs
- SessionStateContainer.cs
- EntityTypeEmitter.cs
- RegistrySecurity.cs
- CollectionChangeEventArgs.cs
- FormsAuthenticationConfiguration.cs
- ADMembershipProvider.cs
- DataSourceHelper.cs
- DependencyPropertyHelper.cs
- GetKeyedHashRequest.cs
- Model3D.cs
- Journal.cs
- PathGeometry.cs
- TypeDescriptionProvider.cs