Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / CollectionType.cs / 1305376 / CollectionType.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; using System.Text; namespace System.Data.Metadata.Edm { ////// Represents the Edm Collection Type /// public sealed class CollectionType : EdmType { #region Constructors ////// The constructor for constructing a CollectionType object with the element type it contains /// /// The element type that this collection type contains ///Thrown if the argument elementType is null internal CollectionType(EdmType elementType) : this(TypeUsage.Create(elementType)) { this.DataSpace = elementType.DataSpace; } ////// The constructor for constructing a CollectionType object with the element type (as a TypeUsage) it contains /// /// The element type that this collection type contains ///Thrown if the argument elementType is null internal CollectionType(TypeUsage elementType) : base(GetIdentity(EntityUtil.GenericCheckArgumentNull(elementType, "elementType")), EdmConstants.TransientNamespace, elementType.EdmType.DataSpace) { _typeUsage = elementType; SetReadOnly(); } #endregion #region Fields private readonly TypeUsage _typeUsage; #endregion #region Properties ////// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.CollectionType; } } ////// The type of the element that this collection type contains /// [MetadataProperty(BuiltInTypeKind.TypeUsage, false)] public TypeUsage TypeUsage { get { return _typeUsage; } } #endregion #region Methods ////// Constructs the name of the collection type /// /// The typeusage for the element type that this collection type refers to ///The identity of the resulting collection type private static string GetIdentity(TypeUsage typeUsage) { StringBuilder builder = new StringBuilder(50); builder.Append("collection["); typeUsage.BuildIdentity(builder); builder.Append("]"); return builder.ToString(); } ////// Override EdmEquals to support value comparison of TypeUsage property /// /// ///internal override bool EdmEquals(MetadataItem item) { // short-circuit if this and other are reference equivalent if (Object.ReferenceEquals(this, item)) { return true; } // check type of item if (null == item || BuiltInTypeKind.CollectionType != item.BuiltInTypeKind) { return false; } CollectionType other = (CollectionType)item; // compare type usage return this.TypeUsage.EdmEquals(other.TypeUsage); } #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
- Quaternion.cs
- Label.cs
- LeaseManager.cs
- SequenceQuery.cs
- RelatedEnd.cs
- CacheEntry.cs
- WebPartUserCapability.cs
- Emitter.cs
- COM2IDispatchConverter.cs
- HttpPostedFile.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- XmlCountingReader.cs
- SamlAssertionKeyIdentifierClause.cs
- MenuItemCollection.cs
- HierarchicalDataBoundControlAdapter.cs
- FilterableAttribute.cs
- Merger.cs
- DirectoryGroupQuery.cs
- EntryPointNotFoundException.cs
- DataControlFieldTypeEditor.cs
- TdsEnums.cs
- SHA256.cs
- Visual.cs
- SqlDataSourceQueryEditor.cs
- TemplateControlCodeDomTreeGenerator.cs
- LineMetrics.cs
- ByteStack.cs
- BaseDataList.cs
- SQLRoleProvider.cs
- CustomCredentialPolicy.cs
- HttpHandler.cs
- _NativeSSPI.cs
- UnsafeNativeMethods.cs
- EventLogTraceListener.cs
- RegexWorker.cs
- TemplateColumn.cs
- KernelTypeValidation.cs
- TrackingMemoryStream.cs
- Helpers.cs
- GetUserPreferenceRequest.cs
- XappLauncher.cs
- ActionFrame.cs
- TemplateColumn.cs
- DesignerSerializationOptionsAttribute.cs
- DataDocumentXPathNavigator.cs
- ScriptServiceAttribute.cs
- NumericExpr.cs
- PerformanceCounterPermissionEntry.cs
- UnmanagedMemoryStream.cs
- ImageCollectionCodeDomSerializer.cs
- PublishLicense.cs
- NavigationWindowAutomationPeer.cs
- DependencyPropertyAttribute.cs
- Win32SafeHandles.cs
- ZipIOCentralDirectoryFileHeader.cs
- ErrorFormatter.cs
- SessionIDManager.cs
- SelectionService.cs
- SoapException.cs
- EditorPart.cs
- FileDataSource.cs
- ObjectDataSourceDesigner.cs
- TypeTypeConverter.cs
- TextServicesPropertyRanges.cs
- GregorianCalendarHelper.cs
- HttpModuleAction.cs
- JsonWriter.cs
- DbProviderServices.cs
- LogReserveAndAppendState.cs
- ApplicationInterop.cs
- Guid.cs
- TextSelection.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- EmptyElement.cs
- ServiceDescriptionReflector.cs
- LicenseProviderAttribute.cs
- ValidationHelpers.cs
- ColorAnimationUsingKeyFrames.cs
- Profiler.cs
- SecurityKeyType.cs
- CapabilitiesRule.cs
- ValidatorCompatibilityHelper.cs
- NullEntityWrapper.cs
- CustomErrorCollection.cs
- OutgoingWebRequestContext.cs
- StdValidatorsAndConverters.cs
- Accessible.cs
- HitTestWithPointDrawingContextWalker.cs
- OrderedDictionary.cs
- RequestContext.cs
- MessageTransmitTraceRecord.cs
- QueryAccessibilityHelpEvent.cs
- GenericParameterDataContract.cs
- Location.cs
- JsonStringDataContract.cs
- WmfPlaceableFileHeader.cs
- SerializationObjectManager.cs
- SocketCache.cs
- MemberExpression.cs
- Attributes.cs