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
- TableSectionStyle.cs
- EditingScope.cs
- GlyphTypeface.cs
- TypeResolvingOptions.cs
- SiteMap.cs
- DiscoveryClientProtocol.cs
- CustomErrorsSection.cs
- RequiredFieldValidator.cs
- AlgoModule.cs
- WmfPlaceableFileHeader.cs
- RequestTimeoutManager.cs
- WindowsStreamSecurityElement.cs
- ParameterBuilder.cs
- PagerStyle.cs
- DecimalStorage.cs
- DocumentXPathNavigator.cs
- SafeNativeMethods.cs
- SearchForVirtualItemEventArgs.cs
- EndEvent.cs
- WindowsListViewGroupHelper.cs
- MediaSystem.cs
- TypeReference.cs
- Scripts.cs
- SharedConnectionWorkflowTransactionService.cs
- ResourceProviderFactory.cs
- StylusPointProperty.cs
- DataGridViewCellCancelEventArgs.cs
- HostedHttpRequestAsyncResult.cs
- log.cs
- ConnectionPoint.cs
- ActiveXHost.cs
- ZoneButton.cs
- MatrixUtil.cs
- FullTextLine.cs
- MutableAssemblyCacheEntry.cs
- PixelFormatConverter.cs
- CodeSnippetExpression.cs
- DESCryptoServiceProvider.cs
- XPathNodeIterator.cs
- GZipDecoder.cs
- ToolStrip.cs
- HwndPanningFeedback.cs
- DependencyObjectProvider.cs
- StringExpressionSet.cs
- TypefaceMetricsCache.cs
- LinqDataSourceInsertEventArgs.cs
- DeflateEmulationStream.cs
- ObjectListShowCommandsEventArgs.cs
- UserNamePasswordClientCredential.cs
- TimeIntervalCollection.cs
- ControlBuilderAttribute.cs
- CompositionAdorner.cs
- ProtocolsSection.cs
- TypeExtensionConverter.cs
- RootDesignerSerializerAttribute.cs
- GenericQueueSurrogate.cs
- QilVisitor.cs
- DataGridViewRowPostPaintEventArgs.cs
- OrderedDictionary.cs
- Brushes.cs
- FirstMatchCodeGroup.cs
- ADMembershipUser.cs
- ProfileManager.cs
- SecurityListenerSettingsLifetimeManager.cs
- PackageRelationshipSelector.cs
- CanonicalFontFamilyReference.cs
- GridViewSortEventArgs.cs
- BooleanConverter.cs
- lengthconverter.cs
- FontFamily.cs
- TypeViewSchema.cs
- SortedList.cs
- IntSecurity.cs
- UpdateProgress.cs
- TabRenderer.cs
- printdlgexmarshaler.cs
- DetailsViewInsertEventArgs.cs
- ValidationErrorCollection.cs
- ClassHandlersStore.cs
- ParameterBuilder.cs
- CookieHandler.cs
- MembershipSection.cs
- TextMessageEncodingBindingElement.cs
- ManagementEventWatcher.cs
- FtpRequestCacheValidator.cs
- DataGridCellsPanel.cs
- AdapterDictionary.cs
- ConfigurationSectionGroupCollection.cs
- PublisherMembershipCondition.cs
- HttpRuntime.cs
- SerialPinChanges.cs
- ThreadStaticAttribute.cs
- DPTypeDescriptorContext.cs
- PieceDirectory.cs
- WasNotInstalledException.cs
- XmlWrappingWriter.cs
- RepeatBehavior.cs
- SiteMapProvider.cs
- ItemCheckedEvent.cs
- JsonFormatGeneratorStatics.cs