Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / RefType.cs / 1305376 / RefType.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 { ////// Class representing a ref type /// public sealed class RefType : EdmType { #region Constructors ////// The constructor for constructing a RefType object with the entity type it references /// /// The entity type that this ref type references ///Thrown if entityType argument is null internal RefType(EntityType entityType) : base(GetIdentity(EntityUtil.GenericCheckArgumentNull(entityType, "entityType")), EdmConstants.TransientNamespace, entityType.DataSpace) { _elementType = entityType; SetReadOnly(); } #endregion #region Fields private readonly EntityTypeBase _elementType; #endregion #region Properties ////// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.RefType; } } ////// The entity type that this ref type references /// [MetadataProperty(BuiltInTypeKind.EntityTypeBase, false)] public EntityTypeBase ElementType { get { return _elementType; } } #endregion #region Methods ////// Constructs the name of the collection type /// /// The entity type base that this ref type refers to ///The identity of the resulting ref type private static string GetIdentity(EntityTypeBase entityTypeBase) { StringBuilder builder = new StringBuilder(50); builder.Append("reference["); entityTypeBase.BuildIdentity(builder); builder.Append("]"); return builder.ToString(); } #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.Text; namespace System.Data.Metadata.Edm { ////// Class representing a ref type /// public sealed class RefType : EdmType { #region Constructors ////// The constructor for constructing a RefType object with the entity type it references /// /// The entity type that this ref type references ///Thrown if entityType argument is null internal RefType(EntityType entityType) : base(GetIdentity(EntityUtil.GenericCheckArgumentNull(entityType, "entityType")), EdmConstants.TransientNamespace, entityType.DataSpace) { _elementType = entityType; SetReadOnly(); } #endregion #region Fields private readonly EntityTypeBase _elementType; #endregion #region Properties ////// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.RefType; } } ////// The entity type that this ref type references /// [MetadataProperty(BuiltInTypeKind.EntityTypeBase, false)] public EntityTypeBase ElementType { get { return _elementType; } } #endregion #region Methods ////// Constructs the name of the collection type /// /// The entity type base that this ref type refers to ///The identity of the resulting ref type private static string GetIdentity(EntityTypeBase entityTypeBase) { StringBuilder builder = new StringBuilder(50); builder.Append("reference["); entityTypeBase.BuildIdentity(builder); builder.Append("]"); return builder.ToString(); } #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
- DoubleLinkList.cs
- RequestCachingSection.cs
- DetailsViewPageEventArgs.cs
- ConfigurationSectionCollection.cs
- wmiprovider.cs
- EdmRelationshipRoleAttribute.cs
- InputScopeNameConverter.cs
- BaseCodePageEncoding.cs
- CreatingCookieEventArgs.cs
- StrongNameUtility.cs
- SecurityState.cs
- ClientProxyGenerator.cs
- BaseTreeIterator.cs
- Crc32Helper.cs
- _ConnectOverlappedAsyncResult.cs
- CompleteWizardStep.cs
- Margins.cs
- LZCodec.cs
- PointCollectionConverter.cs
- RelationshipConverter.cs
- NativeCompoundFileAPIs.cs
- ContextProperty.cs
- HelpProvider.cs
- SystemTcpConnection.cs
- SortDescription.cs
- InputLanguageSource.cs
- TextProperties.cs
- QueryOutputWriter.cs
- OutputCacheProfile.cs
- JsonClassDataContract.cs
- ChannelParameterCollection.cs
- HtmlSelect.cs
- ValueSerializerAttribute.cs
- InvocationExpression.cs
- TypeConstant.cs
- FormViewPageEventArgs.cs
- AutoResetEvent.cs
- TransformConverter.cs
- InputScopeAttribute.cs
- ButtonPopupAdapter.cs
- _SecureChannel.cs
- EventLogPropertySelector.cs
- lengthconverter.cs
- RuntimeEnvironment.cs
- Int32Collection.cs
- OleDbInfoMessageEvent.cs
- StructureChangedEventArgs.cs
- RangeBaseAutomationPeer.cs
- FunctionNode.cs
- TcpProcessProtocolHandler.cs
- XmlQueryContext.cs
- ModelFunction.cs
- dbenumerator.cs
- Crc32.cs
- ResourceManagerWrapper.cs
- ResourcesGenerator.cs
- LineGeometry.cs
- HttpHandlerActionCollection.cs
- MutexSecurity.cs
- SocketAddress.cs
- ImageMapEventArgs.cs
- ListBoxAutomationPeer.cs
- MarkupCompiler.cs
- ManagedIStream.cs
- XPathAncestorQuery.cs
- IIS7UserPrincipal.cs
- TextServicesDisplayAttributePropertyRanges.cs
- ListViewTableCell.cs
- HashHelper.cs
- DataGridTable.cs
- MimeMultiPart.cs
- PriorityItem.cs
- RequestCacheEntry.cs
- IProducerConsumerCollection.cs
- AvtEvent.cs
- JoinCqlBlock.cs
- FieldTemplateUserControl.cs
- RelationshipConverter.cs
- ContractComponent.cs
- localization.cs
- FileDialog.cs
- WebPartUtil.cs
- Transform3D.cs
- ProjectionPlanCompiler.cs
- PriorityBinding.cs
- MachineKeyConverter.cs
- TextBounds.cs
- Convert.cs
- QueryRewriter.cs
- counter.cs
- ConstraintManager.cs
- ItemDragEvent.cs
- Point3D.cs
- SymbolPair.cs
- PerformanceCounterLib.cs
- AddInToken.cs
- BaseCodeDomTreeGenerator.cs
- SqlGenerator.cs
- SQLChars.cs
- DocumentSchemaValidator.cs