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
- QilLoop.cs
- DesignerActionItem.cs
- HttpHostedTransportConfiguration.cs
- MultiAsyncResult.cs
- ViewKeyConstraint.cs
- InstalledFontCollection.cs
- Point.cs
- CodeDomSerializerBase.cs
- XdrBuilder.cs
- WebPartConnectionsConnectVerb.cs
- Soap11ServerProtocol.cs
- ListViewInsertionMark.cs
- SecurityElement.cs
- AttachedPropertyMethodSelector.cs
- SqlCacheDependencySection.cs
- DesignTimeParseData.cs
- SqlMethods.cs
- ToolStripDropDown.cs
- DateTimeFormatInfo.cs
- ListViewDeleteEventArgs.cs
- PolyBezierSegment.cs
- EncryptedKey.cs
- ProxyWebPartConnectionCollection.cs
- XmlSchemaAttributeGroup.cs
- AssemblyAssociatedContentFileAttribute.cs
- SqlParameterCollection.cs
- StringUtil.cs
- ValueUnavailableException.cs
- BitStack.cs
- ThreadSafeList.cs
- ECDsa.cs
- XmlTypeMapping.cs
- FrameworkElement.cs
- ListViewDeletedEventArgs.cs
- WsdlInspector.cs
- WebPartEditorOkVerb.cs
- FixedBufferAttribute.cs
- CurrencyWrapper.cs
- XPathEmptyIterator.cs
- ClockController.cs
- RectangleHotSpot.cs
- PartialArray.cs
- AndAlso.cs
- XmlBoundElement.cs
- COM2ICategorizePropertiesHandler.cs
- InvokeBinder.cs
- WebPartEditorOkVerb.cs
- Button.cs
- NativeWindow.cs
- DocumentsTrace.cs
- PrivilegeNotHeldException.cs
- WebPartRestoreVerb.cs
- NumericExpr.cs
- HybridDictionary.cs
- NameService.cs
- DataKeyArray.cs
- ControlBindingsConverter.cs
- WebHttpSecurity.cs
- ApplicationHost.cs
- GridPattern.cs
- TextViewBase.cs
- ParagraphResult.cs
- XmlnsCache.cs
- EntityContainerEmitter.cs
- AxisAngleRotation3D.cs
- SequentialOutput.cs
- dataobject.cs
- CommentGlyph.cs
- WebPartConnection.cs
- VirtualizingStackPanel.cs
- D3DImage.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- GenerateTemporaryTargetAssembly.cs
- DbConnectionFactory.cs
- ProcessHostConfigUtils.cs
- StaticExtensionConverter.cs
- UndoManager.cs
- DiscoveryOperationContextExtension.cs
- WindowsSysHeader.cs
- FtpRequestCacheValidator.cs
- TableRowCollection.cs
- ClientRuntimeConfig.cs
- DecimalConverter.cs
- AnnotationAuthorChangedEventArgs.cs
- GraphicsPath.cs
- XmlSchemaAppInfo.cs
- DateTimeUtil.cs
- DataGridCaption.cs
- BufferModesCollection.cs
- InheritanceAttribute.cs
- TreeBuilder.cs
- DataGridCheckBoxColumn.cs
- Point.cs
- GZipDecoder.cs
- WmlControlAdapter.cs
- ContainsSearchOperator.cs
- NativeCppClassAttribute.cs
- RIPEMD160.cs
- ReferenceService.cs
- RadioButton.cs