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
- ParseElementCollection.cs
- InvokePatternIdentifiers.cs
- TextTreeDeleteContentUndoUnit.cs
- PageParserFilter.cs
- ObjectKeyFrameCollection.cs
- ObservableCollection.cs
- LinqDataSourceEditData.cs
- AmbientProperties.cs
- ListBoxItemAutomationPeer.cs
- AttributeAction.cs
- ServiceOperationParameter.cs
- Material.cs
- ImportException.cs
- ChildTable.cs
- SqlNodeTypeOperators.cs
- DBNull.cs
- DesignerEventService.cs
- XMLSyntaxException.cs
- RegexRunnerFactory.cs
- DataRow.cs
- ProviderException.cs
- GeneratedContractType.cs
- ValidationPropertyAttribute.cs
- RepeaterItemCollection.cs
- WebConfigurationHostFileChange.cs
- Setter.cs
- PointLight.cs
- WinFormsSpinner.cs
- figurelengthconverter.cs
- InputElement.cs
- SectionXmlInfo.cs
- GetWinFXPath.cs
- TemplateControlParser.cs
- HttpRuntimeSection.cs
- ExpandableObjectConverter.cs
- NetStream.cs
- WindowsScroll.cs
- ToolboxItemFilterAttribute.cs
- ReadOnlyMetadataCollection.cs
- XmlSchemas.cs
- ApplicationInfo.cs
- TimeSpanHelper.cs
- embossbitmapeffect.cs
- SharedPersonalizationStateInfo.cs
- DataServiceQueryOfT.cs
- Int16Converter.cs
- GenericNameHandler.cs
- GetWinFXPath.cs
- StringArrayConverter.cs
- SegmentInfo.cs
- AlgoModule.cs
- NoneExcludedImageIndexConverter.cs
- CryptoStream.cs
- FileInfo.cs
- HttpHostedTransportConfiguration.cs
- TextTabProperties.cs
- TextDecoration.cs
- NamespaceTable.cs
- CreateDataSourceDialog.cs
- ObjectContext.cs
- LinqDataSourceHelper.cs
- XPathNavigatorKeyComparer.cs
- DataServiceProcessingPipeline.cs
- MonikerBuilder.cs
- DisplayNameAttribute.cs
- RequestTimeoutManager.cs
- ProbeRequestResponseAsyncResult.cs
- ProfileBuildProvider.cs
- RegexCompiler.cs
- AccessControlEntry.cs
- RegexRunner.cs
- PropertyEntry.cs
- SqlExpressionNullability.cs
- RepeaterItemEventArgs.cs
- ReadOnlyPropertyMetadata.cs
- SpellerError.cs
- PerformanceCounter.cs
- GridViewEditEventArgs.cs
- ExtenderControl.cs
- ProvidePropertyAttribute.cs
- X509Extension.cs
- TransportOutputChannel.cs
- ComplusEndpointConfigContainer.cs
- MethodExecutor.cs
- CultureTable.cs
- PagesSection.cs
- ExpressionParser.cs
- SqlNodeAnnotations.cs
- StructuralObject.cs
- EntryIndex.cs
- ImageSource.cs
- SmtpSection.cs
- SafeRightsManagementHandle.cs
- MethodInfo.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- ToolStripContentPanel.cs
- HashHelper.cs
- XmlDataSource.cs
- ComboBox.cs
- LocalValueEnumerator.cs