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
- WebPartZoneAutoFormat.cs
- codemethodreferenceexpression.cs
- xamlnodes.cs
- PageCatalogPart.cs
- Int32.cs
- CreateUserWizard.cs
- TextModifierScope.cs
- ListViewContainer.cs
- AccessControlEntry.cs
- SoapProtocolReflector.cs
- CultureSpecificStringDictionary.cs
- EventData.cs
- WSHttpBindingBaseElement.cs
- SafeNativeMemoryHandle.cs
- DefaultProfileManager.cs
- AssemblyAttributes.cs
- LeafCellTreeNode.cs
- SHA1.cs
- SystemEvents.cs
- TextContainerChangedEventArgs.cs
- KeyConstraint.cs
- PropertyGridEditorPart.cs
- ToolStripOverflow.cs
- AppDomainEvidenceFactory.cs
- DllNotFoundException.cs
- MatrixConverter.cs
- XNodeValidator.cs
- grammarelement.cs
- CounterCreationDataCollection.cs
- CSharpCodeProvider.cs
- SharedUtils.cs
- DataSourceCache.cs
- ADConnectionHelper.cs
- BitmapInitialize.cs
- SHA384.cs
- CellTreeNode.cs
- WebRequestModulesSection.cs
- PropertyGridCommands.cs
- BaseResourcesBuildProvider.cs
- TaiwanLunisolarCalendar.cs
- LinqToSqlWrapper.cs
- TextReader.cs
- Duration.cs
- TCEAdapterGenerator.cs
- Substitution.cs
- ServiceObjectContainer.cs
- SqlExpressionNullability.cs
- SymmetricKeyWrap.cs
- TabletCollection.cs
- IdnMapping.cs
- PageVisual.cs
- ObjectKeyFrameCollection.cs
- ResourceReferenceExpressionConverter.cs
- MessageQueuePermissionEntryCollection.cs
- FontInfo.cs
- DecodeHelper.cs
- MdiWindowListStrip.cs
- Compilation.cs
- ToolStripOverflowButton.cs
- LocalizabilityAttribute.cs
- StructureChangedEventArgs.cs
- GridViewDesigner.cs
- X509SubjectKeyIdentifierClause.cs
- FocusManager.cs
- DbSetClause.cs
- WebPartConnectionsDisconnectVerb.cs
- PrimitiveXmlSerializers.cs
- RealizationDrawingContextWalker.cs
- SharedMemory.cs
- TextReturnReader.cs
- FormsAuthentication.cs
- TraceSection.cs
- ExpandoObject.cs
- PeerOutputChannel.cs
- DataFormats.cs
- DataListItem.cs
- DefaultPropertiesToSend.cs
- NamespaceDisplay.xaml.cs
- ByteViewer.cs
- SoapEnumAttribute.cs
- DesignerTransactionCloseEvent.cs
- Encoder.cs
- Stack.cs
- RemotingSurrogateSelector.cs
- BinaryObjectWriter.cs
- DPCustomTypeDescriptor.cs
- WhiteSpaceTrimStringConverter.cs
- DetailsViewRowCollection.cs
- ToolBarTray.cs
- ExtendedPropertyCollection.cs
- MachineSettingsSection.cs
- MobileResource.cs
- TextDpi.cs
- FunctionDescription.cs
- FontDialog.cs
- SourceItem.cs
- TransformedBitmap.cs
- mediaclock.cs
- ToolStripComboBox.cs
- BamlLocalizer.cs