Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- Literal.cs
- FormsAuthenticationModule.cs
- BindingBase.cs
- RepeatEnumerable.cs
- SectionXmlInfo.cs
- FolderLevelBuildProvider.cs
- ImmComposition.cs
- ToolStripItemEventArgs.cs
- TextDecorationCollection.cs
- OnOperation.cs
- CodeAttributeArgument.cs
- CaseInsensitiveHashCodeProvider.cs
- ReturnValue.cs
- EventRouteFactory.cs
- TableHeaderCell.cs
- HierarchicalDataTemplate.cs
- Rotation3D.cs
- WorkflowOperationErrorHandler.cs
- Privilege.cs
- ClusterSafeNativeMethods.cs
- CodeSubDirectory.cs
- ProgressBarRenderer.cs
- DiagnosticTraceSource.cs
- DecoderFallback.cs
- CharacterBuffer.cs
- CellRelation.cs
- Predicate.cs
- ObjectItemCollection.cs
- ShaderEffect.cs
- DynamicDocumentPaginator.cs
- BinaryReader.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- TailPinnedEventArgs.cs
- PerfCounterSection.cs
- HyperlinkAutomationPeer.cs
- HandlerMappingMemo.cs
- NamedServiceModelExtensionCollectionElement.cs
- DirectoryNotFoundException.cs
- HtmlTableCellCollection.cs
- DataConnectionHelper.cs
- RunInstallerAttribute.cs
- WindowsComboBox.cs
- SelectedCellsCollection.cs
- CollectionBase.cs
- AsnEncodedData.cs
- CommandHelpers.cs
- StreamUpgradeInitiator.cs
- PrintController.cs
- SafeCryptContextHandle.cs
- XmlSchemaCollection.cs
- DateTimeFormatInfoScanner.cs
- WhiteSpaceTrimStringConverter.cs
- Mapping.cs
- PeerNameRecord.cs
- CodeAccessSecurityEngine.cs
- QuaternionAnimationUsingKeyFrames.cs
- SettingsContext.cs
- PopupEventArgs.cs
- PrintController.cs
- DataGridViewRowsRemovedEventArgs.cs
- Tracer.cs
- StrongNamePublicKeyBlob.cs
- StrongNameMembershipCondition.cs
- PromptBuilder.cs
- ExpressionSelection.cs
- CodeIdentifier.cs
- HierarchicalDataBoundControl.cs
- RuleRef.cs
- TimeEnumHelper.cs
- ManagedIStream.cs
- BitmapEffectInput.cs
- EntityType.cs
- SiteMapDataSource.cs
- XmlNamespaceDeclarationsAttribute.cs
- GridItem.cs
- ClientBuildManager.cs
- DataGridViewComboBoxCell.cs
- OpCopier.cs
- MetadataItemCollectionFactory.cs
- QilPatternVisitor.cs
- InvocationExpression.cs
- Pens.cs
- StrongNameKeyPair.cs
- InternalTransaction.cs
- ListViewInsertedEventArgs.cs
- ColumnReorderedEventArgs.cs
- EntityRecordInfo.cs
- BulletedListEventArgs.cs
- CodeActivityContext.cs
- PeerService.cs
- HMACSHA512.cs
- HexParser.cs
- PassportAuthenticationModule.cs
- Convert.cs
- AtomEntry.cs
- TypeContext.cs
- MemberMaps.cs
- DataSourceView.cs
- Renderer.cs
- WorkflowRuntime.cs