Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / util.cs / 1305376 / util.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- 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 [Conditional("DEBUG")] internal static void AssertItemHasIdentity(MetadataItem item, string argumentName) { Debug.Assert(!string.IsNullOrEmpty(item.Identity), "Item has empty identity."); EntityUtil.GenericCheckArgumentNull(item, argumentName); } #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- 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 [Conditional("DEBUG")] internal static void AssertItemHasIdentity(MetadataItem item, string argumentName) { Debug.Assert(!string.IsNullOrEmpty(item.Identity), "Item has empty identity."); EntityUtil.GenericCheckArgumentNull(item, 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
- ViewValidator.cs
- TypeToken.cs
- WindowsFormsHostAutomationPeer.cs
- Splitter.cs
- MouseEvent.cs
- ScriptReferenceBase.cs
- ApplicationFileCodeDomTreeGenerator.cs
- FormViewUpdatedEventArgs.cs
- Util.cs
- SelectorItemAutomationPeer.cs
- ResourcesGenerator.cs
- TransportChannelListener.cs
- SimpleTypeResolver.cs
- MessageEventSubscriptionService.cs
- AsnEncodedData.cs
- SearchForVirtualItemEventArgs.cs
- Utils.cs
- VirtualPath.cs
- SyntaxCheck.cs
- StringKeyFrameCollection.cs
- XmlAttributeProperties.cs
- BidirectionalDictionary.cs
- DataObjectMethodAttribute.cs
- GeneralTransform3D.cs
- Executor.cs
- WebPartAddingEventArgs.cs
- remotingproxy.cs
- HttpProfileBase.cs
- Span.cs
- HttpClientCredentialType.cs
- XmlReader.cs
- Util.cs
- WriteStateInfoBase.cs
- DataGridColumnHeadersPresenter.cs
- CreateParams.cs
- Int16Storage.cs
- GetWinFXPath.cs
- WorkflowViewService.cs
- BackgroundWorker.cs
- MembershipPasswordException.cs
- SafeReadContext.cs
- OleDbException.cs
- ManipulationDelta.cs
- VisualBrush.cs
- URLString.cs
- EncryptedKeyHashIdentifierClause.cs
- DelimitedListTraceListener.cs
- DataSourceView.cs
- ZipIOBlockManager.cs
- EndSelectCardRequest.cs
- DocumentPageHost.cs
- DbProviderFactory.cs
- ImageInfo.cs
- MissingManifestResourceException.cs
- TargetControlTypeCache.cs
- WebPartsPersonalizationAuthorization.cs
- Html32TextWriter.cs
- XPathChildIterator.cs
- NameTable.cs
- WindowsSecurityToken.cs
- SpoolingTaskBase.cs
- DataListItem.cs
- HwndSource.cs
- RegexBoyerMoore.cs
- DbParameterCollectionHelper.cs
- ToolStripControlHost.cs
- Rotation3DKeyFrameCollection.cs
- CodeThrowExceptionStatement.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- WSHttpTransportSecurityElement.cs
- SiteMapPathDesigner.cs
- DataSourceSerializationException.cs
- ComplexObject.cs
- SqlNodeTypeOperators.cs
- Bits.cs
- VersionedStream.cs
- filewebrequest.cs
- Geometry.cs
- Scene3D.cs
- ServiceBuildProvider.cs
- StateMachineWorkflowDesigner.cs
- MediaContext.cs
- ToolboxControl.cs
- Wildcard.cs
- VirtualPathUtility.cs
- DesignerSerializationOptionsAttribute.cs
- SliderAutomationPeer.cs
- FtpRequestCacheValidator.cs
- FlowDocumentPageViewerAutomationPeer.cs
- PrefixQName.cs
- TableRowCollection.cs
- FlagsAttribute.cs
- CleanUpVirtualizedItemEventArgs.cs
- TableLayoutCellPaintEventArgs.cs
- QilSortKey.cs
- RegexBoyerMoore.cs
- RelationHandler.cs
- DataBoundLiteralControl.cs
- PropertyInformation.cs
- Command.cs