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
- DataListItemCollection.cs
- ResourceManager.cs
- ToolStripDropDownClosedEventArgs.cs
- Msec.cs
- MenuItemBinding.cs
- WmlTextViewAdapter.cs
- RightsManagementInformation.cs
- GiveFeedbackEvent.cs
- AdPostCacheSubstitution.cs
- ICollection.cs
- SessionEndingCancelEventArgs.cs
- XmlException.cs
- FrugalList.cs
- FileLogRecordHeader.cs
- MetadataItemSerializer.cs
- NamespaceDecl.cs
- _LocalDataStoreMgr.cs
- MappedMetaModel.cs
- HashMembershipCondition.cs
- DbProviderFactory.cs
- LeftCellWrapper.cs
- Classification.cs
- DataControlFieldCell.cs
- ActiveDocumentEvent.cs
- TypedTableBaseExtensions.cs
- HostingEnvironment.cs
- PropertyMap.cs
- BufferedGraphicsContext.cs
- DisposableCollectionWrapper.cs
- HttpChannelHelper.cs
- DocumentReferenceCollection.cs
- Journaling.cs
- DesignerOptionService.cs
- ReachPrintTicketSerializerAsync.cs
- AndCondition.cs
- ThreadPoolTaskScheduler.cs
- BitmapEditor.cs
- ToolStripLabel.cs
- MimeTypeMapper.cs
- ITreeGenerator.cs
- ButtonFlatAdapter.cs
- HotSpotCollection.cs
- PiiTraceSource.cs
- PersonalizablePropertyEntry.cs
- AmbientValueAttribute.cs
- CodeDirectoryCompiler.cs
- XmlObjectSerializerWriteContext.cs
- UpDownEvent.cs
- DetailsViewPagerRow.cs
- XhtmlBasicValidationSummaryAdapter.cs
- TableLayout.cs
- HttpRuntime.cs
- ToolStripOverflowButton.cs
- BamlStream.cs
- ChangeInterceptorAttribute.cs
- EditCommandColumn.cs
- CharacterMetricsDictionary.cs
- X509Certificate2.cs
- RowUpdatedEventArgs.cs
- WebPermission.cs
- Popup.cs
- ScriptingRoleServiceSection.cs
- safelinkcollection.cs
- Effect.cs
- XhtmlConformanceSection.cs
- SqlVisitor.cs
- unitconverter.cs
- CategoriesDocumentFormatter.cs
- FixedTextContainer.cs
- DBAsyncResult.cs
- TableLayoutColumnStyleCollection.cs
- FileIOPermission.cs
- XPathArrayIterator.cs
- __Filters.cs
- ContentTextAutomationPeer.cs
- ResourceDescriptionAttribute.cs
- TargetParameterCountException.cs
- EdmFunction.cs
- WindowsToolbar.cs
- UIElement3D.cs
- DataServiceQueryProvider.cs
- DataGridToolTip.cs
- ConfigXmlAttribute.cs
- RequestCacheEntry.cs
- DispatcherHookEventArgs.cs
- WpfSharedBamlSchemaContext.cs
- LineInfo.cs
- BindingExpression.cs
- ConnectorRouter.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- ListViewSelectEventArgs.cs
- ThemeDirectoryCompiler.cs
- QuadraticEase.cs
- RtfNavigator.cs
- DbSetClause.cs
- EntityContainerAssociationSetEnd.cs
- BitmapInitialize.cs
- TemplateBaseAction.cs
- Timer.cs
- TrackBar.cs