Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / util.cs / 1 / util.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; using System.Diagnostics; using System.Text; namespace System.Data.Metadata.Edm { ////// Class holding utility functions for metadata /// internal static class Util { #region Methods ////// Throws an appropriate exception if the given item is a readonly, used when an attempt is made to change /// a property /// /// The item whose readonly is being tested internal static void ThrowIfReadOnly(MetadataItem item) { Debug.Assert(item != null, "The given item is null"); if (item.IsReadOnly) { throw EntityUtil.OperationOnReadOnlyItem(); } } ////// Check to make sure the given item do have identity /// /// The item to check for valid identity /// The name of the argument internal static void CheckItemHasIdentity(MetadataItem item, string argumentName) { EntityUtil.GenericCheckArgumentNull(item, argumentName); if (string.IsNullOrEmpty(item.Identity)) { throw EntityUtil.EmptyIdentity(argumentName); } } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....], [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; using System.Diagnostics; using System.Text; namespace System.Data.Metadata.Edm { ////// Class holding utility functions for metadata /// internal static class Util { #region Methods ////// Throws an appropriate exception if the given item is a readonly, used when an attempt is made to change /// a property /// /// The item whose readonly is being tested internal static void ThrowIfReadOnly(MetadataItem item) { Debug.Assert(item != null, "The given item is null"); if (item.IsReadOnly) { throw EntityUtil.OperationOnReadOnlyItem(); } } ////// Check to make sure the given item do have identity /// /// The item to check for valid identity /// The name of the argument internal static void CheckItemHasIdentity(MetadataItem item, string argumentName) { EntityUtil.GenericCheckArgumentNull(item, argumentName); if (string.IsNullOrEmpty(item.Identity)) { throw EntityUtil.EmptyIdentity(argumentName); } } #endregion } } // 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
- AttachedAnnotation.cs
- PointCollection.cs
- InstanceLockedException.cs
- Missing.cs
- XamlTemplateSerializer.cs
- SecurityUniqueId.cs
- XmlSchemaSimpleTypeUnion.cs
- Pen.cs
- CollectionChangedEventManager.cs
- ControlsConfig.cs
- MemberPathMap.cs
- StreamReader.cs
- ControlValuePropertyAttribute.cs
- PrimitiveSchema.cs
- PenContexts.cs
- NativeWindow.cs
- CriticalExceptions.cs
- PageHandlerFactory.cs
- FileInfo.cs
- RSAPKCS1KeyExchangeDeformatter.cs
- TransformerTypeCollection.cs
- BuildProvider.cs
- FrameworkElementFactoryMarkupObject.cs
- EndOfStreamException.cs
- Run.cs
- ReverseInheritProperty.cs
- PlanCompilerUtil.cs
- Vector3DAnimationUsingKeyFrames.cs
- UnsafeNativeMethods.cs
- CompilerTypeWithParams.cs
- TemplateKeyConverter.cs
- IgnoreSectionHandler.cs
- AssemblyResourceLoader.cs
- ThreadAbortException.cs
- InternalsVisibleToAttribute.cs
- PassportAuthenticationModule.cs
- DataStreams.cs
- TemplateBindingExpressionConverter.cs
- BitmapSourceSafeMILHandle.cs
- ResourceCategoryAttribute.cs
- ListViewItemMouseHoverEvent.cs
- ClientUIRequest.cs
- TaskbarItemInfo.cs
- JpegBitmapDecoder.cs
- OletxEnlistment.cs
- Command.cs
- InvalidMessageContractException.cs
- SpellerHighlightLayer.cs
- IncomingWebRequestContext.cs
- LocalizedNameDescriptionPair.cs
- Membership.cs
- ProfileProvider.cs
- OutOfProcStateClientManager.cs
- StreamGeometry.cs
- InvokeProviderWrapper.cs
- StylusEventArgs.cs
- User.cs
- QilTernary.cs
- GetPageNumberCompletedEventArgs.cs
- TcpChannelListener.cs
- TableParagraph.cs
- OdbcConnection.cs
- Header.cs
- ObjectViewEntityCollectionData.cs
- RootProfilePropertySettingsCollection.cs
- AnimatedTypeHelpers.cs
- SemanticAnalyzer.cs
- SQLInt32.cs
- ContentDesigner.cs
- DataGridView.cs
- Version.cs
- XmlResolver.cs
- Paragraph.cs
- NativeMethods.cs
- ConstructorExpr.cs
- basecomparevalidator.cs
- SecurityContext.cs
- ProcessThread.cs
- WsdlHelpGeneratorElement.cs
- Control.cs
- ObjectDataSourceMethodEventArgs.cs
- OracleException.cs
- BaseTemplateParser.cs
- ErrorWebPart.cs
- GridViewPageEventArgs.cs
- RadialGradientBrush.cs
- KeyboardDevice.cs
- MarshalDirectiveException.cs
- MouseActionConverter.cs
- WpfSharedBamlSchemaContext.cs
- entitydatasourceentitysetnameconverter.cs
- SafeWaitHandle.cs
- RawStylusActions.cs
- ContentType.cs
- OrderByLifter.cs
- M3DUtil.cs
- TcpClientChannel.cs
- TextElementEnumerator.cs
- IisTraceListener.cs
- SmiEventStream.cs