Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- CodeExpressionStatement.cs
- SqlCommand.cs
- HwndSource.cs
- TextBoxBase.cs
- SafeSecurityHandles.cs
- Journaling.cs
- NamedPipeChannelListener.cs
- SystemIPGlobalProperties.cs
- SocketPermission.cs
- RC2CryptoServiceProvider.cs
- ChildDocumentBlock.cs
- CompModSwitches.cs
- GetPageNumberCompletedEventArgs.cs
- Axis.cs
- sortedlist.cs
- Model3DCollection.cs
- NegationPusher.cs
- ReferencedType.cs
- BigInt.cs
- PropertyValidationContext.cs
- AuthenticateEventArgs.cs
- SqlStatistics.cs
- FieldNameLookup.cs
- RichTextBoxAutomationPeer.cs
- SqlUserDefinedTypeAttribute.cs
- OLEDB_Enum.cs
- DependencyPropertyHelper.cs
- Attribute.cs
- SqlParameterizer.cs
- XPathParser.cs
- HttpModuleAction.cs
- CustomValidator.cs
- PageContentAsyncResult.cs
- HtmlTableCell.cs
- TextFormatterContext.cs
- SafeSecurityHandles.cs
- SqlNotificationRequest.cs
- Highlights.cs
- FixedSOMFixedBlock.cs
- BamlLocalizabilityResolver.cs
- RegexParser.cs
- WebPermission.cs
- TextFormatterContext.cs
- XamlWrapperReaders.cs
- SolidBrush.cs
- Substitution.cs
- MetadataUtilsSmi.cs
- Command.cs
- GiveFeedbackEvent.cs
- Events.cs
- ConnectionsZoneAutoFormat.cs
- PeerApplicationLaunchInfo.cs
- SystemFonts.cs
- ExtendedProperty.cs
- ScriptModule.cs
- IIS7UserPrincipal.cs
- KeyManager.cs
- CompilationSection.cs
- DataComponentGenerator.cs
- XsltFunctions.cs
- HtmlForm.cs
- NullableDecimalMinMaxAggregationOperator.cs
- AspNetHostingPermission.cs
- Propagator.Evaluator.cs
- QilReference.cs
- ConstraintEnumerator.cs
- DataSourceProvider.cs
- TextTreeObjectNode.cs
- PackWebRequestFactory.cs
- TypeBuilder.cs
- KerberosRequestorSecurityToken.cs
- FontStyleConverter.cs
- DiscoveryMessageSequenceCD1.cs
- AttachedPropertyMethodSelector.cs
- DateTimeFormat.cs
- Matrix3DValueSerializer.cs
- TextDecorations.cs
- ValidationHelper.cs
- LayoutEngine.cs
- Rules.cs
- SamlConditions.cs
- DataGridViewRow.cs
- WebRequestModuleElementCollection.cs
- PropertyReferenceExtension.cs
- MatrixKeyFrameCollection.cs
- QueuedDeliveryRequirementsMode.cs
- SocketInformation.cs
- AutomationPeer.cs
- Attributes.cs
- DialogResultConverter.cs
- VisualStyleInformation.cs
- InvokeProviderWrapper.cs
- ScriptControlManager.cs
- Pkcs9Attribute.cs
- Console.cs
- LookupTables.cs
- RegexInterpreter.cs
- RichListBox.cs
- MatrixIndependentAnimationStorage.cs
- RemoteWebConfigurationHost.cs