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
- X509Certificate2.cs
- PropertyItem.cs
- WebPartEditorOkVerb.cs
- TextDocumentView.cs
- ResourceDescriptionAttribute.cs
- PersonalizationProvider.cs
- EnumValidator.cs
- ColumnResizeAdorner.cs
- Vector.cs
- BindingExpression.cs
- String.cs
- TemplateEditingFrame.cs
- SafePEFileHandle.cs
- securitymgrsite.cs
- DataStorage.cs
- DataControlFieldTypeEditor.cs
- brushes.cs
- Serialization.cs
- PersistenceTypeAttribute.cs
- PropertyStore.cs
- NumberSubstitution.cs
- GB18030Encoding.cs
- FillErrorEventArgs.cs
- MimeObjectFactory.cs
- XmlMtomReader.cs
- BitmapVisualManager.cs
- CommandExpr.cs
- MachineSettingsSection.cs
- TextTreeNode.cs
- SamlAdvice.cs
- ClockController.cs
- OdbcErrorCollection.cs
- SignatureConfirmations.cs
- DictionaryBase.cs
- PriorityChain.cs
- EncoderReplacementFallback.cs
- WebException.cs
- DeploymentSectionCache.cs
- COMException.cs
- Header.cs
- InternalResources.cs
- PointLight.cs
- ParallelLoopState.cs
- XmlSchemaInferenceException.cs
- XmlCharType.cs
- KeyConverter.cs
- Color.cs
- SqlNodeTypeOperators.cs
- MenuStrip.cs
- StringUtil.cs
- VisualStyleElement.cs
- HtmlMeta.cs
- SystemException.cs
- AssemblyInfo.cs
- RelatedCurrencyManager.cs
- Vector.cs
- TrackingValidationObjectDictionary.cs
- ConnectionStringsExpressionBuilder.cs
- RoleGroupCollection.cs
- TextMetrics.cs
- PenContext.cs
- FunctionQuery.cs
- EUCJPEncoding.cs
- CompressStream.cs
- ReaderContextStackData.cs
- CreationContext.cs
- Win32SafeHandles.cs
- DataSourceHelper.cs
- UnsafeNativeMethods.cs
- CodeExporter.cs
- ControlBuilder.cs
- Roles.cs
- TCPClient.cs
- DataObject.cs
- EasingQuaternionKeyFrame.cs
- DiffuseMaterial.cs
- TimeZone.cs
- Int64Animation.cs
- QueryCreatedEventArgs.cs
- SmiConnection.cs
- ObjectDataSourceFilteringEventArgs.cs
- CachedFontFace.cs
- MaskedTextProvider.cs
- ErrorProvider.cs
- ArrayConverter.cs
- MatrixCamera.cs
- BooleanFunctions.cs
- OracleParameterCollection.cs
- ObjectViewQueryResultData.cs
- CatalogPartCollection.cs
- EntityDataSourceDataSelectionPanel.designer.cs
- InputReportEventArgs.cs
- DetailsViewInsertEventArgs.cs
- TraceSwitch.cs
- InvokeGenerator.cs
- StackOverflowException.cs
- SpecularMaterial.cs
- TextBoxBase.cs
- OdbcException.cs
- WebPartConnectionsCancelVerb.cs