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
- SrgsText.cs
- EdmComplexPropertyAttribute.cs
- WpfWebRequestHelper.cs
- SqlDataReader.cs
- BamlLocalizer.cs
- XmlSchemaValidationException.cs
- ValidationEventArgs.cs
- BinaryObjectInfo.cs
- MsmqIntegrationReceiveParameters.cs
- XmlElementList.cs
- Thumb.cs
- HtmlElementCollection.cs
- Mapping.cs
- TranslateTransform.cs
- RotateTransform.cs
- XmlObjectSerializerReadContext.cs
- RuntimeWrappedException.cs
- PropertyDescriptorGridEntry.cs
- LinearGradientBrush.cs
- ViewSimplifier.cs
- FontNamesConverter.cs
- SurrogateSelector.cs
- VirtualPathData.cs
- DataSetViewSchema.cs
- ApplicationHost.cs
- TraceEventCache.cs
- ServiceEndpointAssociationProvider.cs
- UxThemeWrapper.cs
- RenderDataDrawingContext.cs
- Claim.cs
- ECDiffieHellmanCngPublicKey.cs
- SmtpSection.cs
- SendKeys.cs
- TripleDESCryptoServiceProvider.cs
- DataSysAttribute.cs
- ItemsChangedEventArgs.cs
- ServiceContractListItem.cs
- glyphs.cs
- HttpApplication.cs
- ChannelServices.cs
- DiscardableAttribute.cs
- NamedPipeWorkerProcess.cs
- SqlDataSourceCache.cs
- FlowDocument.cs
- AutomationIdentifierGuids.cs
- SpecialFolderEnumConverter.cs
- ImageListStreamer.cs
- Utility.cs
- CatalogZone.cs
- AutomationEvent.cs
- BuildManagerHost.cs
- ListArgumentProvider.cs
- CapabilitiesSection.cs
- XsdCachingReader.cs
- ValueUnavailableException.cs
- DataServiceQueryProvider.cs
- PrinterSettings.cs
- PasswordRecovery.cs
- WindowsGraphicsWrapper.cs
- TableLayoutStyleCollection.cs
- ReadOnlyNameValueCollection.cs
- XsltArgumentList.cs
- XmlToDatasetMap.cs
- ImmutableClientRuntime.cs
- UseLicense.cs
- MessageQueueKey.cs
- EditorPartChrome.cs
- CancelEventArgs.cs
- coordinatorfactory.cs
- RequestTimeoutManager.cs
- SqlUtils.cs
- CustomBindingElement.cs
- TrustLevelCollection.cs
- Attributes.cs
- HtmlInputPassword.cs
- SmtpReplyReaderFactory.cs
- GraphicsState.cs
- FamilyMap.cs
- XmlObjectSerializerReadContextComplexJson.cs
- DataGridViewLinkCell.cs
- TimeSpan.cs
- JsonGlobals.cs
- Action.cs
- _StreamFramer.cs
- OperandQuery.cs
- InfoCardSymmetricAlgorithm.cs
- ContentPathSegment.cs
- AliasExpr.cs
- PeerContact.cs
- SrgsElement.cs
- ToolStripDropDownClosedEventArgs.cs
- TemplateParser.cs
- DesigntimeLicenseContextSerializer.cs
- RectAnimationClockResource.cs
- MenuCommand.cs
- DurableDispatcherAddressingFault.cs
- Encoder.cs
- DataGridViewCellFormattingEventArgs.cs
- DesignColumnCollection.cs
- FileChangesMonitor.cs