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
- QilInvokeEarlyBound.cs
- WhiteSpaceTrimStringConverter.cs
- MutexSecurity.cs
- CultureTableRecord.cs
- DataServiceRequestOfT.cs
- CalendarDataBindingHandler.cs
- StrokeNodeData.cs
- NamespaceInfo.cs
- XmlSchemaParticle.cs
- SettingsAttributes.cs
- SqlBuilder.cs
- ListBoxItemWrapperAutomationPeer.cs
- WebPartManagerInternals.cs
- EnvelopedPkcs7.cs
- DataConnectionHelper.cs
- BinHexDecoder.cs
- HttpCapabilitiesBase.cs
- ResumeStoryboard.cs
- BordersPage.cs
- XPathBuilder.cs
- SafeNativeMethods.cs
- RequestCacheValidator.cs
- AtomEntry.cs
- ApplicationFileParser.cs
- ExtensionWindow.cs
- WebPartVerbCollection.cs
- DataGridItem.cs
- VirtualizingStackPanel.cs
- EmptyReadOnlyDictionaryInternal.cs
- SystemIPGlobalStatistics.cs
- PingReply.cs
- DataObjectAttribute.cs
- FrameDimension.cs
- CodeTypeParameterCollection.cs
- TextTreeObjectNode.cs
- cookie.cs
- Expression.cs
- listviewsubitemcollectioneditor.cs
- DbConnectionPoolCounters.cs
- HtmlTitle.cs
- ListDesigner.cs
- CodeIterationStatement.cs
- CodeRemoveEventStatement.cs
- BitVector32.cs
- SecurityElement.cs
- DataGridViewCellStateChangedEventArgs.cs
- ClientViaElement.cs
- MeshGeometry3D.cs
- RijndaelManagedTransform.cs
- RadioButtonBaseAdapter.cs
- MDIClient.cs
- Stroke2.cs
- XmlSigningNodeWriter.cs
- Point4D.cs
- ServicePointManagerElement.cs
- ContentOperations.cs
- XmlSubtreeReader.cs
- HMAC.cs
- NetworkStream.cs
- WebPartHelpVerb.cs
- _emptywebproxy.cs
- ValidationEventArgs.cs
- CqlBlock.cs
- InvalidProgramException.cs
- SourceInterpreter.cs
- DbConnectionPoolIdentity.cs
- ToolBarButtonClickEvent.cs
- GC.cs
- ServiceThrottlingElement.cs
- HttpCookie.cs
- EnumerableWrapperWeakToStrong.cs
- NullableConverter.cs
- BitmapEffectDrawingContextState.cs
- TimeSpanConverter.cs
- SHA1CryptoServiceProvider.cs
- odbcmetadatacolumnnames.cs
- KeyNotFoundException.cs
- HttpPostedFile.cs
- PersonalizationStateInfo.cs
- EntityContainer.cs
- XmlSchemaParticle.cs
- TaskFormBase.cs
- Bidi.cs
- EntityDataSourceQueryBuilder.cs
- TextServicesHost.cs
- SinglePageViewer.cs
- RedirectionProxy.cs
- CachedFontFace.cs
- StreamAsIStream.cs
- AutoResetEvent.cs
- HandlerFactoryCache.cs
- datacache.cs
- HybridDictionary.cs
- ResourceExpressionBuilder.cs
- Transform3DCollection.cs
- WindowsSysHeader.cs
- XPathNodeList.cs
- ScriptReference.cs
- PropertyDescriptorComparer.cs
- WebRequestModuleElementCollection.cs