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
- InvokeAction.cs
- DSASignatureDeformatter.cs
- OptimalTextSource.cs
- GacUtil.cs
- ChildTable.cs
- WaitHandle.cs
- Style.cs
- OperationValidationEventArgs.cs
- TailCallAnalyzer.cs
- DesignObjectWrapper.cs
- ItemList.cs
- FixedNode.cs
- RangeValuePatternIdentifiers.cs
- TimeSpanValidator.cs
- RectAnimationClockResource.cs
- TextReader.cs
- InkSerializer.cs
- EnvironmentPermission.cs
- HTMLTextWriter.cs
- GPStream.cs
- DesigntimeLicenseContextSerializer.cs
- OleDbSchemaGuid.cs
- DataGridViewColumnCollectionEditor.cs
- IdentityModelDictionary.cs
- FontDriver.cs
- MsmqBindingFilter.cs
- UserValidatedEventArgs.cs
- ListViewContainer.cs
- CannotUnloadAppDomainException.cs
- DataGridViewCheckBoxCell.cs
- EntityDataSourceUtil.cs
- HtmlTernaryTree.cs
- WorkflowTerminatedException.cs
- DWriteFactory.cs
- XmlSchemaValidator.cs
- TextDecoration.cs
- ScriptManagerProxy.cs
- DbConnectionPool.cs
- UpdateProgress.cs
- MobilePage.cs
- WindowHideOrCloseTracker.cs
- SqlStream.cs
- DataGridViewRowStateChangedEventArgs.cs
- StoreUtilities.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- VirtualDirectoryMapping.cs
- CollectionsUtil.cs
- CompareInfo.cs
- DeferredReference.cs
- RangeExpression.cs
- FactoryRecord.cs
- documentsequencetextview.cs
- ToolStripItemCollection.cs
- WindowsListView.cs
- QilPatternVisitor.cs
- SessionSwitchEventArgs.cs
- RewritingSimplifier.cs
- ClientTargetSection.cs
- CompositeFontParser.cs
- XmlNodeList.cs
- RelationshipEndMember.cs
- KeyBinding.cs
- LinqDataSourceDisposeEventArgs.cs
- ColumnHeaderConverter.cs
- _CommandStream.cs
- UnitySerializationHolder.cs
- DispatcherSynchronizationContext.cs
- DynamicPropertyHolder.cs
- DataRelation.cs
- CodeLabeledStatement.cs
- GroupItem.cs
- SmtpMail.cs
- SQLMoneyStorage.cs
- KoreanCalendar.cs
- _FtpControlStream.cs
- _CommandStream.cs
- IndicShape.cs
- ExpandableObjectConverter.cs
- ConfigPathUtility.cs
- PointHitTestResult.cs
- GACMembershipCondition.cs
- TabPanel.cs
- UserCancellationException.cs
- EventProviderBase.cs
- Site.cs
- SchemaAttDef.cs
- MultiPropertyDescriptorGridEntry.cs
- StoreConnection.cs
- DataGridViewRowPostPaintEventArgs.cs
- CodeGroup.cs
- ThicknessConverter.cs
- SiteMapPath.cs
- ManagementEventWatcher.cs
- TraceListeners.cs
- RenameRuleObjectDialog.Designer.cs
- FileReader.cs
- SerializationSectionGroup.cs
- Asn1IntegerConverter.cs
- ObjectViewListener.cs
- ObjectSecurityT.cs