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
- LogWriteRestartAreaAsyncResult.cs
- Nullable.cs
- AssemblyCache.cs
- RecognizedPhrase.cs
- VSWCFServiceContractGenerator.cs
- TraceUtils.cs
- EntityDataSourceView.cs
- TransactedBatchingBehavior.cs
- SetterBase.cs
- _SslState.cs
- TypeNameParser.cs
- StringToken.cs
- StringExpressionSet.cs
- NonPrimarySelectionGlyph.cs
- ObjectCloneHelper.cs
- TemplateXamlParser.cs
- DynamicDataExtensions.cs
- Nullable.cs
- HttpTransportBindingElement.cs
- CodeCastExpression.cs
- FlowLayoutSettings.cs
- DeviceFiltersSection.cs
- DeploymentExceptionMapper.cs
- EmptyEnumerator.cs
- ServiceContractListItem.cs
- DrawTreeNodeEventArgs.cs
- DependencyProperty.cs
- ProviderBase.cs
- ProfileInfo.cs
- View.cs
- ProfileSettings.cs
- HtmlForm.cs
- RegexCharClass.cs
- KeyConstraint.cs
- TableItemStyle.cs
- CompareInfo.cs
- CodeTypeReferenceExpression.cs
- FormsAuthenticationCredentials.cs
- EventWaitHandleSecurity.cs
- WebPartTracker.cs
- SelectionPattern.cs
- PrimaryKeyTypeConverter.cs
- ManualResetEvent.cs
- DataGridViewRow.cs
- ObjectDataSourceView.cs
- OleStrCAMarshaler.cs
- PersistenceTypeAttribute.cs
- SelectionChangedEventArgs.cs
- EncryptedPackageFilter.cs
- DesignerActionPropertyItem.cs
- Panel.cs
- OneToOneMappingSerializer.cs
- SamlEvidence.cs
- HttpModuleActionCollection.cs
- RegexCompilationInfo.cs
- FillBehavior.cs
- Camera.cs
- ToolBar.cs
- MessageQueueAccessControlEntry.cs
- MaskInputRejectedEventArgs.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ChannelProtectionRequirements.cs
- SQLDoubleStorage.cs
- InvokeHandlers.cs
- GetWinFXPath.cs
- RolePrincipal.cs
- WaitHandleCannotBeOpenedException.cs
- PartialClassGenerationTaskInternal.cs
- OleDbRowUpdatingEvent.cs
- Grid.cs
- XmlSchemaChoice.cs
- SQLDateTimeStorage.cs
- PropertyConverter.cs
- NamedPipeTransportManager.cs
- WeakReferenceList.cs
- PasswordPropertyTextAttribute.cs
- DataKey.cs
- ClipboardProcessor.cs
- SqlClientFactory.cs
- DataColumnPropertyDescriptor.cs
- ExceptionAggregator.cs
- Bits.cs
- SparseMemoryStream.cs
- ContextToken.cs
- PrintControllerWithStatusDialog.cs
- WebServiceResponse.cs
- SqlUserDefinedTypeAttribute.cs
- UnsafeCollabNativeMethods.cs
- listitem.cs
- EventTrigger.cs
- ActivityValidationServices.cs
- DataServiceQueryOfT.cs
- XmlElementAttributes.cs
- HostingEnvironmentWrapper.cs
- IIS7WorkerRequest.cs
- OuterGlowBitmapEffect.cs
- ProfileGroupSettingsCollection.cs
- TerminateSequenceResponse.cs
- Fonts.cs
- Panel.cs