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
- ClientScriptItem.cs
- SuspendDesigner.cs
- ObjectQuery_EntitySqlExtensions.cs
- LoadedOrUnloadedOperation.cs
- DesignOnlyAttribute.cs
- ThreadStaticAttribute.cs
- DependentTransaction.cs
- SchemaCollectionCompiler.cs
- DesignerTransactionCloseEvent.cs
- KeyInstance.cs
- PersonalizationAdministration.cs
- HyperLinkColumn.cs
- httpstaticobjectscollection.cs
- TemplateControlParser.cs
- EventBuilder.cs
- AsymmetricSignatureFormatter.cs
- BeginSelectCardRequest.cs
- CodeSnippetStatement.cs
- SqlDataSourceCustomCommandPanel.cs
- TableLayoutSettingsTypeConverter.cs
- BinaryObjectWriter.cs
- DesignerPerfEventProvider.cs
- InfoCardTraceRecord.cs
- CryptoProvider.cs
- TextTreeTextElementNode.cs
- MouseBinding.cs
- SymbolType.cs
- CommentAction.cs
- ComNativeDescriptor.cs
- PolyBezierSegmentFigureLogic.cs
- WebScriptMetadataFormatter.cs
- FontFamilyIdentifier.cs
- CfgRule.cs
- ControlAdapter.cs
- ActivityInstanceMap.cs
- MultiView.cs
- PolicyChain.cs
- VisualTreeHelper.cs
- WebBrowserPermission.cs
- Context.cs
- BulletedList.cs
- EventWaitHandleSecurity.cs
- ImageAutomationPeer.cs
- SystemIPv6InterfaceProperties.cs
- TypeDescriptor.cs
- ByteStreamGeometryContext.cs
- XmlDataProvider.cs
- HttpApplicationStateBase.cs
- KeyInterop.cs
- RtfToken.cs
- GradientStop.cs
- BaseCAMarshaler.cs
- AccessDataSource.cs
- Operator.cs
- ExpandableObjectConverter.cs
- PageFunction.cs
- StateMachineWorkflowDesigner.cs
- DiagnosticsConfigurationHandler.cs
- ToolStripHighContrastRenderer.cs
- CharKeyFrameCollection.cs
- Span.cs
- Matrix.cs
- TraceContextRecord.cs
- codemethodreferenceexpression.cs
- OrderedParallelQuery.cs
- Membership.cs
- OletxVolatileEnlistment.cs
- counter.cs
- PreservationFileWriter.cs
- IOThreadScheduler.cs
- CfgSemanticTag.cs
- WebSysDefaultValueAttribute.cs
- TrackingConditionCollection.cs
- SmtpMail.cs
- XPathMultyIterator.cs
- LinearGradientBrush.cs
- ObjectManager.cs
- ReferenceEqualityComparer.cs
- StructureChangedEventArgs.cs
- ServiceModelEnumValidator.cs
- ListBindingConverter.cs
- WeakReadOnlyCollection.cs
- TextBox.cs
- ImageIndexConverter.cs
- CodeAttributeArgumentCollection.cs
- GetPageCompletedEventArgs.cs
- SchemaElement.cs
- ClipboardData.cs
- EventHandlerList.cs
- MsmqHostedTransportConfiguration.cs
- ForEachAction.cs
- coordinatorfactory.cs
- DataControlImageButton.cs
- ManipulationDevice.cs
- NullReferenceException.cs
- CatalogPartChrome.cs
- ConfigurationSettings.cs
- OutputWindow.cs
- WasHttpHandlersInstallComponent.cs
- AuthenticationManager.cs