Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- TreeViewEvent.cs
- TCPListener.cs
- XmlWrappingReader.cs
- UidManager.cs
- ToolboxDataAttribute.cs
- XmlLinkedNode.cs
- WebBrowserNavigatedEventHandler.cs
- SafeSystemMetrics.cs
- CodeArrayIndexerExpression.cs
- TextFormatterContext.cs
- CompositeActivityCodeGenerator.cs
- RpcResponse.cs
- GridViewUpdatedEventArgs.cs
- TreeNodeCollection.cs
- Camera.cs
- ActivityDesigner.cs
- Hyperlink.cs
- Empty.cs
- HealthMonitoringSection.cs
- MyContact.cs
- FileSecurity.cs
- basemetadatamappingvisitor.cs
- SqlDataRecord.cs
- State.cs
- DecoderBestFitFallback.cs
- AttributeProviderAttribute.cs
- Int32Converter.cs
- ToolZone.cs
- FrameSecurityDescriptor.cs
- HiddenField.cs
- TableParagraph.cs
- PlaceHolder.cs
- OracleSqlParser.cs
- MessageDispatch.cs
- BuildManager.cs
- DataRowView.cs
- Action.cs
- ToolBarOverflowPanel.cs
- DesignerAttribute.cs
- Int32CollectionValueSerializer.cs
- InputBinder.cs
- TextSpanModifier.cs
- BypassElement.cs
- FirewallWrapper.cs
- ParallelDesigner.cs
- UDPClient.cs
- TableRowCollection.cs
- ListBase.cs
- IndentedWriter.cs
- XmlNamespaceMapping.cs
- FilterElement.cs
- TemplateControl.cs
- TypedDatasetGenerator.cs
- RectAnimationClockResource.cs
- ProtocolsConfigurationHandler.cs
- XmlCharacterData.cs
- SplineQuaternionKeyFrame.cs
- _SslState.cs
- HGlobalSafeHandle.cs
- DefaultObjectMappingItemCollection.cs
- DuplexSecurityProtocolFactory.cs
- PocoPropertyAccessorStrategy.cs
- SafeProcessHandle.cs
- HtmlHead.cs
- OperatingSystemVersionCheck.cs
- TextModifierScope.cs
- UnicastIPAddressInformationCollection.cs
- TimeoutValidationAttribute.cs
- WeakReferenceList.cs
- SQLDecimalStorage.cs
- Query.cs
- ClonableStack.cs
- ExpandCollapsePattern.cs
- MDIControlStrip.cs
- StringReader.cs
- SrgsItemList.cs
- TimeZone.cs
- BitmapMetadata.cs
- DocumentGridContextMenu.cs
- XmlDocument.cs
- DeclarationUpdate.cs
- DBAsyncResult.cs
- Matrix3D.cs
- RsaElement.cs
- SubMenuStyleCollection.cs
- XmlAttributeCache.cs
- TreeIterator.cs
- AsyncResult.cs
- MenuCommands.cs
- ModuleElement.cs
- BitmapMetadata.cs
- XmlAttributeAttribute.cs
- DateTimeConstantAttribute.cs
- XmlNamespaceDeclarationsAttribute.cs
- RuntimeConfig.cs
- XmlException.cs
- DesignerTransaction.cs
- WebBrowserNavigatedEventHandler.cs
- RijndaelManagedTransform.cs
- DateTimeOffset.cs