Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / util.cs / 1305376 / util.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
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
[Conditional("DEBUG")]
internal static void AssertItemHasIdentity(MetadataItem item, string argumentName)
{
Debug.Assert(!string.IsNullOrEmpty(item.Identity), "Item has empty identity.");
EntityUtil.GenericCheckArgumentNull(item, argumentName);
}
#endregion
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
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
[Conditional("DEBUG")]
internal static void AssertItemHasIdentity(MetadataItem item, string argumentName)
{
Debug.Assert(!string.IsNullOrEmpty(item.Identity), "Item has empty identity.");
EntityUtil.GenericCheckArgumentNull(item, 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
- Manipulation.cs
- SQLInt16Storage.cs
- MergePropertyDescriptor.cs
- ConnectionString.cs
- QuotedPrintableStream.cs
- EnumerableRowCollection.cs
- DataBindingExpressionBuilder.cs
- IssuanceLicense.cs
- ClientOptions.cs
- TreeNodeConverter.cs
- ParseChildrenAsPropertiesAttribute.cs
- PolygonHotSpot.cs
- PropertyChangeTracker.cs
- HostProtectionPermission.cs
- PerformanceCounterPermissionEntryCollection.cs
- SetStoryboardSpeedRatio.cs
- UnSafeCharBuffer.cs
- XmlDictionaryReader.cs
- InlineUIContainer.cs
- WebPartMenuStyle.cs
- GeneralTransformGroup.cs
- ActivationServices.cs
- MobileControlDesigner.cs
- DbFunctionCommandTree.cs
- MasterPageCodeDomTreeGenerator.cs
- AppDomainShutdownMonitor.cs
- StandardToolWindows.cs
- ExtendedProtectionPolicy.cs
- DataGridTableCollection.cs
- EqualityComparer.cs
- StylusEditingBehavior.cs
- RequestStatusBarUpdateEventArgs.cs
- GeneralTransform2DTo3D.cs
- MessageHeaderInfoTraceRecord.cs
- WinInetCache.cs
- IgnoreFileBuildProvider.cs
- ChangeConflicts.cs
- SqlDataSourceCommandParser.cs
- Visual.cs
- SwitchLevelAttribute.cs
- XmlSortKeyAccumulator.cs
- Padding.cs
- AutoGeneratedField.cs
- FixedSOMElement.cs
- ResourceCodeDomSerializer.cs
- SerializationIncompleteException.cs
- TagMapInfo.cs
- XPathParser.cs
- HWStack.cs
- XmlWrappingWriter.cs
- StateChangeEvent.cs
- Cursor.cs
- ProcessHostServerConfig.cs
- CodeTypeParameter.cs
- AutomationPatternInfo.cs
- DbConnectionPool.cs
- BitmapEffectCollection.cs
- BatchStream.cs
- TemplateComponentConnector.cs
- DataMemberFieldConverter.cs
- ListItemConverter.cs
- DecimalAnimation.cs
- OutputCacheSettings.cs
- PropertyInformationCollection.cs
- GACIdentityPermission.cs
- ConnectionInterfaceCollection.cs
- ListViewSelectEventArgs.cs
- ObjectDataSourceFilteringEventArgs.cs
- ObjectDataSource.cs
- AssertFilter.cs
- XmlSerializerAssemblyAttribute.cs
- UpdateException.cs
- CaseStatementSlot.cs
- Timer.cs
- NodeFunctions.cs
- HostedTransportConfigurationBase.cs
- CallbackHandler.cs
- BackgroundFormatInfo.cs
- TextTreeRootNode.cs
- EncoderBestFitFallback.cs
- BaseTransportHeaders.cs
- GPStream.cs
- DispatcherOperation.cs
- HttpContextServiceHost.cs
- TabControlEvent.cs
- TextElementEnumerator.cs
- AddressUtility.cs
- SizeAnimationBase.cs
- ProxyWebPart.cs
- MsmqChannelFactory.cs
- StringConcat.cs
- EntityContainerEntitySet.cs
- PartitionResolver.cs
- PersonalizationEntry.cs
- CreateRefExpr.cs
- DataList.cs
- NumberFunctions.cs
- PhysicalFontFamily.cs
- Button.cs
- Merger.cs