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
- PenThread.cs
- CompositeFontInfo.cs
- DesignerVerbCollection.cs
- DocumentReferenceCollection.cs
- TrackingLocationCollection.cs
- UserMapPath.cs
- SecurityRuntime.cs
- XmlSchemaChoice.cs
- PersonalizationStateInfoCollection.cs
- ProvidePropertyAttribute.cs
- PropertyItemInternal.cs
- WorkflowDesignerColors.cs
- PositiveTimeSpanValidatorAttribute.cs
- ExceptionUtil.cs
- EntityUtil.cs
- ToolStripItem.cs
- WebPartChrome.cs
- AsymmetricKeyExchangeFormatter.cs
- SimpleHandlerFactory.cs
- RootAction.cs
- CompositeScriptReferenceEventArgs.cs
- AnimationLayer.cs
- BasicExpandProvider.cs
- BitmapScalingModeValidation.cs
- DataControlFieldCollection.cs
- HttpRuntime.cs
- TextEffect.cs
- WebHttpBinding.cs
- DrawingServices.cs
- HttpResponseMessageProperty.cs
- RepeaterItemEventArgs.cs
- HMACSHA384.cs
- XmlnsDictionary.cs
- DownloadProgressEventArgs.cs
- OptimisticConcurrencyException.cs
- DataSourceXmlAttributeAttribute.cs
- FieldDescriptor.cs
- GridViewPageEventArgs.cs
- Comparer.cs
- ItemsControlAutomationPeer.cs
- StorageFunctionMapping.cs
- WriterOutput.cs
- ShapingWorkspace.cs
- UpDownBase.cs
- ChannelSinkStacks.cs
- RichTextBoxAutomationPeer.cs
- SafeViewOfFileHandle.cs
- IdentityReference.cs
- WaitHandle.cs
- DictionaryEditChange.cs
- CodeTypeDelegate.cs
- BitmapCodecInfo.cs
- SimplePropertyEntry.cs
- Enum.cs
- HitTestResult.cs
- ApplicationContext.cs
- Span.cs
- InvocationExpression.cs
- ExpandSegmentCollection.cs
- SamlEvidence.cs
- Property.cs
- ColumnPropertiesGroup.cs
- TextRangeSerialization.cs
- ProfileBuildProvider.cs
- ClientBuildManager.cs
- AxisAngleRotation3D.cs
- StylusEditingBehavior.cs
- Context.cs
- MenuScrollingVisibilityConverter.cs
- FixedSOMImage.cs
- UInt64.cs
- SingleStorage.cs
- BamlLocalizationDictionary.cs
- SequentialUshortCollection.cs
- ScriptResourceHandler.cs
- ReferenceSchema.cs
- StructuredTypeEmitter.cs
- ItemList.cs
- ChtmlCommandAdapter.cs
- ProjectedSlot.cs
- HttpPostedFile.cs
- ImageListImage.cs
- odbcmetadatafactory.cs
- RootAction.cs
- CacheSection.cs
- XXXOnTypeBuilderInstantiation.cs
- RemotingConfiguration.cs
- BrowserDefinitionCollection.cs
- TemplateColumn.cs
- XmlBinaryReader.cs
- FormattedTextSymbols.cs
- ToolStrip.cs
- PageSettings.cs
- FontFamilyIdentifier.cs
- ISAPIWorkerRequest.cs
- BinHexEncoder.cs
- URLIdentityPermission.cs
- TemplatedAdorner.cs
- FacetValueContainer.cs
- ResolveDuplexAsyncResult.cs