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
- PerfCounters.cs
- ReadOnlyDataSourceView.cs
- UdpContractFilterBehavior.cs
- CodeAttributeArgumentCollection.cs
- XPathDocumentBuilder.cs
- sqlpipe.cs
- RelatedPropertyManager.cs
- Size.cs
- LocatorManager.cs
- ColumnResizeAdorner.cs
- HtmlControlPersistable.cs
- XPathSelfQuery.cs
- XmlSchemaGroup.cs
- GridViewRow.cs
- TextTreePropertyUndoUnit.cs
- Repeater.cs
- MemberDomainMap.cs
- GacUtil.cs
- XPathNavigatorReader.cs
- DocumentPaginator.cs
- DataFormats.cs
- SpellerError.cs
- OracleFactory.cs
- JsonCollectionDataContract.cs
- RealProxy.cs
- ScriptingAuthenticationServiceSection.cs
- EntityModelBuildProvider.cs
- BitmapMetadata.cs
- UInt32Converter.cs
- SmtpAuthenticationManager.cs
- Buffer.cs
- Registry.cs
- UIntPtr.cs
- Underline.cs
- AssemblyInfo.cs
- ControllableStoryboardAction.cs
- ContextQuery.cs
- APCustomTypeDescriptor.cs
- CustomTrackingQuery.cs
- PageContentAsyncResult.cs
- XamlFilter.cs
- DataSvcMapFile.cs
- QilStrConcat.cs
- XsltLibrary.cs
- WorkflowMessageEventArgs.cs
- TableHeaderCell.cs
- WindowsRegion.cs
- AnnotationAdorner.cs
- SerializationHelper.cs
- CompilerParameters.cs
- ConfigXmlText.cs
- MulticastNotSupportedException.cs
- ReadOnlyDictionary.cs
- Bold.cs
- UiaCoreProviderApi.cs
- RSAOAEPKeyExchangeDeformatter.cs
- EqualityArray.cs
- ResolveResponse.cs
- SqlDataSourceCache.cs
- IItemContainerGenerator.cs
- CanonicalXml.cs
- StorageRoot.cs
- SafeCryptoHandles.cs
- ACE.cs
- HttpInputStream.cs
- BufferedGraphicsContext.cs
- AssemblyNameProxy.cs
- DataRecordInternal.cs
- RuntimeHandles.cs
- WebPartDescriptionCollection.cs
- GlyphsSerializer.cs
- DebugController.cs
- RawStylusSystemGestureInputReport.cs
- __Filters.cs
- WmlCalendarAdapter.cs
- PhoneCallDesigner.cs
- PermissionSetTriple.cs
- XmlSchemaInfo.cs
- NameValueConfigurationCollection.cs
- Mutex.cs
- XmlElement.cs
- GeneratedView.cs
- RegistryPermission.cs
- KerberosSecurityTokenAuthenticator.cs
- ISAPIApplicationHost.cs
- DashStyle.cs
- XmlImplementation.cs
- SizeF.cs
- DataGridItemEventArgs.cs
- MsmqHostedTransportConfiguration.cs
- LinqDataSourceHelper.cs
- RegionData.cs
- ForceCopyBuildProvider.cs
- MILUtilities.cs
- SchemaImporterExtensionElementCollection.cs
- RegexCapture.cs
- TypeConverterHelper.cs
- RoleManagerSection.cs
- DataControlLinkButton.cs
- XmlSchemaElement.cs