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
- ZipIOEndOfCentralDirectoryBlock.cs
- InputReport.cs
- WebBrowserHelper.cs
- IDispatchConstantAttribute.cs
- ValueChangedEventManager.cs
- DbCommandTree.cs
- ToolTip.cs
- TableLayoutCellPaintEventArgs.cs
- Point.cs
- AppSettingsSection.cs
- SqlXml.cs
- ReflectionTypeLoadException.cs
- Predicate.cs
- SqlFactory.cs
- TypeUsageBuilder.cs
- CollectionChangeEventArgs.cs
- DebugViewWriter.cs
- SqlDataSourceView.cs
- TextElementCollectionHelper.cs
- HtmlProps.cs
- Stack.cs
- XpsColorContext.cs
- RequestResizeEvent.cs
- ShaderEffect.cs
- RichTextBoxContextMenu.cs
- DesignerExtenders.cs
- AppDomainAttributes.cs
- CollectionViewProxy.cs
- HelpEvent.cs
- TransformGroup.cs
- Match.cs
- SelectedDatesCollection.cs
- ObjectViewEntityCollectionData.cs
- TextBox.cs
- RSAPKCS1KeyExchangeFormatter.cs
- OdbcDataAdapter.cs
- PasswordRecoveryAutoFormat.cs
- SchemaImporterExtension.cs
- XmlSchemaSimpleTypeRestriction.cs
- TextServicesPropertyRanges.cs
- InfoCardRSAPKCS1KeyExchangeFormatter.cs
- SoapWriter.cs
- SqlDependency.cs
- RoleGroupCollection.cs
- RightNameExpirationInfoPair.cs
- Binding.cs
- DataService.cs
- MappingItemCollection.cs
- Parser.cs
- DeflateEmulationStream.cs
- ToolStripDesignerAvailabilityAttribute.cs
- DataGridTemplateColumn.cs
- ZipIOLocalFileHeader.cs
- WindowsRichEditRange.cs
- XmlNotation.cs
- Encoding.cs
- Menu.cs
- CollectionViewSource.cs
- ContractMapping.cs
- Journal.cs
- PrivateFontCollection.cs
- FieldAccessException.cs
- MetadataArtifactLoaderComposite.cs
- ISAPIWorkerRequest.cs
- DbProviderFactoriesConfigurationHandler.cs
- MenuRendererStandards.cs
- CodeMethodMap.cs
- HashHelpers.cs
- ReaderWriterLock.cs
- TextRangeAdaptor.cs
- SocketElement.cs
- InputProcessorProfiles.cs
- SelfSignedCertificate.cs
- EditorZoneBase.cs
- XmlAnyElementAttributes.cs
- TextWriterTraceListener.cs
- ConstrainedGroup.cs
- BinaryUtilClasses.cs
- DataTableTypeConverter.cs
- PersonalizationDictionary.cs
- LocalizationCodeDomSerializer.cs
- SqlTrackingQuery.cs
- LOSFormatter.cs
- DataKeyCollection.cs
- FontNameConverter.cs
- SafeThemeHandle.cs
- KeyPullup.cs
- DateTimeValueSerializer.cs
- EventListenerClientSide.cs
- PersonalizationStateInfoCollection.cs
- DbConnectionPool.cs
- DatasetMethodGenerator.cs
- SqlError.cs
- XmlNode.cs
- DocumentApplication.cs
- GenerateHelper.cs
- DockPanel.cs
- PropertyEmitter.cs
- String.cs
- ToolStripDropDownMenu.cs