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
- MbpInfo.cs
- Vector3DIndependentAnimationStorage.cs
- PersonalizableAttribute.cs
- CompilerScope.Storage.cs
- MemoryFailPoint.cs
- NewItemsContextMenuStrip.cs
- JsonReader.cs
- ToolBarTray.cs
- DSACryptoServiceProvider.cs
- WebBrowsableAttribute.cs
- SingleTagSectionHandler.cs
- TextTreeUndoUnit.cs
- DataGridViewSelectedColumnCollection.cs
- ContentDesigner.cs
- QilInvokeEarlyBound.cs
- DivideByZeroException.cs
- QilTernary.cs
- SynchronizationContext.cs
- MailMessageEventArgs.cs
- AnnotationResourceCollection.cs
- ConsumerConnectionPointCollection.cs
- EventToken.cs
- IndexingContentUnit.cs
- WebPartAuthorizationEventArgs.cs
- BinHexDecoder.cs
- XhtmlMobileTextWriter.cs
- InfoCardTraceRecord.cs
- xdrvalidator.cs
- TabItem.cs
- ReferentialConstraintRoleElement.cs
- ResXResourceSet.cs
- RegexRunner.cs
- RawStylusInputCustomData.cs
- SamlAdvice.cs
- XmlSerializer.cs
- XmlSchemaNotation.cs
- ByteBufferPool.cs
- MsmqIntegrationAppDomainProtocolHandler.cs
- ConstraintStruct.cs
- SqlResolver.cs
- Exceptions.cs
- LinqToSqlWrapper.cs
- NamespaceEmitter.cs
- RadioButtonList.cs
- OleDbInfoMessageEvent.cs
- DodSequenceMerge.cs
- TreeBuilderXamlTranslator.cs
- SqlStatistics.cs
- ResourceDefaultValueAttribute.cs
- XamlNamespaceHelper.cs
- SiteMapProvider.cs
- PresentationSource.cs
- DataGridViewEditingControlShowingEventArgs.cs
- PipelineModuleStepContainer.cs
- WriteTimeStream.cs
- PrintDocument.cs
- shaperfactoryquerycacheentry.cs
- Msec.cs
- SqlBuilder.cs
- StoreItemCollection.cs
- path.cs
- ResourceProviderFactory.cs
- IsolatedStorageFilePermission.cs
- Membership.cs
- SecurityHeader.cs
- clipboard.cs
- BitmapEffectDrawingContextWalker.cs
- AnimationStorage.cs
- ArraySet.cs
- ToolStripTextBox.cs
- SessionEndingCancelEventArgs.cs
- DataServicePagingProviderWrapper.cs
- CollectionType.cs
- ScheduleChanges.cs
- PeerNode.cs
- ValueQuery.cs
- ToolStripItemEventArgs.cs
- DataGridCell.cs
- WindowsListViewItemStartMenu.cs
- MachineKeySection.cs
- TextDecorationCollection.cs
- HttpCookieCollection.cs
- FtpWebRequest.cs
- Vars.cs
- BinaryObjectInfo.cs
- DataServiceContext.cs
- VolatileEnlistmentMultiplexing.cs
- ChildrenQuery.cs
- MessageSmuggler.cs
- DataGridLength.cs
- DataRecord.cs
- TcpStreams.cs
- DispatchChannelSink.cs
- dtdvalidator.cs
- XmlQueryType.cs
- Enum.cs
- PropertyChangingEventArgs.cs
- EncoderExceptionFallback.cs
- Stack.cs
- SafeArrayTypeMismatchException.cs