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
- SQLMembershipProvider.cs
- PenThreadWorker.cs
- PageVisual.cs
- ObjectDataSourceEventArgs.cs
- WebPartCloseVerb.cs
- SqlBulkCopyColumnMappingCollection.cs
- CorrelationHandle.cs
- DictionaryBase.cs
- DomainUpDown.cs
- RotateTransform3D.cs
- PagedControl.cs
- StyleSelector.cs
- StylusPointCollection.cs
- ExpressionEditorSheet.cs
- MemberInitExpression.cs
- ExpressionBuilder.cs
- Int32CollectionConverter.cs
- MatrixKeyFrameCollection.cs
- HtmlElementEventArgs.cs
- httpstaticobjectscollection.cs
- ToolStripContentPanelDesigner.cs
- MediaScriptCommandRoutedEventArgs.cs
- CatalogPartCollection.cs
- EmptyArray.cs
- WebPartAuthorizationEventArgs.cs
- DocumentReference.cs
- TreeNode.cs
- TextChange.cs
- CodeIdentifier.cs
- RootProfilePropertySettingsCollection.cs
- HitTestWithPointDrawingContextWalker.cs
- OrderedDictionary.cs
- WindowsSecurityToken.cs
- AmbientLight.cs
- BevelBitmapEffect.cs
- ResourceDescriptionAttribute.cs
- TextElementCollectionHelper.cs
- CheckBoxList.cs
- ItemsControlAutomationPeer.cs
- XmlWrappingWriter.cs
- LineUtil.cs
- StringHandle.cs
- MetadataItemEmitter.cs
- ErrorWebPart.cs
- securitymgrsite.cs
- RealizationDrawingContextWalker.cs
- NetDataContractSerializer.cs
- PreservationFileReader.cs
- AsyncCompletedEventArgs.cs
- httpserverutility.cs
- ReadOnlyCollectionBase.cs
- ThicknessConverter.cs
- unitconverter.cs
- ToolStripSettings.cs
- DefaultTraceListener.cs
- TypeExtensionConverter.cs
- XmlFormatExtensionPrefixAttribute.cs
- mansign.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- XmlSerializationWriter.cs
- FontNamesConverter.cs
- CatalogPartChrome.cs
- OLEDB_Util.cs
- ListSourceHelper.cs
- CompilationLock.cs
- ProgressiveCrcCalculatingStream.cs
- RequestQueue.cs
- DataGridViewRowConverter.cs
- PerformanceCounterPermissionAttribute.cs
- ChannelServices.cs
- ValueSerializer.cs
- HttpStreamFormatter.cs
- MultiDataTrigger.cs
- HierarchicalDataBoundControl.cs
- DBBindings.cs
- BamlLocalizer.cs
- columnmapkeybuilder.cs
- GenericUriParser.cs
- BitmapMetadata.cs
- RadioButton.cs
- RoutedEventArgs.cs
- LinqDataView.cs
- DataGridViewEditingControlShowingEventArgs.cs
- BufferedStream.cs
- SerializationUtility.cs
- MenuItemBindingCollection.cs
- DataGridViewUtilities.cs
- XmlDocumentFieldSchema.cs
- SqlColumnizer.cs
- OutputCacheSection.cs
- FlowThrottle.cs
- PeerCollaboration.cs
- Attributes.cs
- DataSourceGroupCollection.cs
- MonthChangedEventArgs.cs
- RowType.cs
- CollectionBuilder.cs
- HttpModuleCollection.cs
- CookielessHelper.cs
- FolderLevelBuildProviderCollection.cs