Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / RefType.cs / 1 / RefType.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
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 [....], [....]
//---------------------------------------------------------------------
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
- ComponentDispatcher.cs
- FixedFindEngine.cs
- SQLInt16Storage.cs
- LinqToSqlWrapper.cs
- DelegatingStream.cs
- _AutoWebProxyScriptEngine.cs
- CompositeFontParser.cs
- TaskResultSetter.cs
- Trigger.cs
- SmiEventSink_DeferedProcessing.cs
- ExtensionElementCollection.cs
- PageCatalogPart.cs
- SqlInfoMessageEvent.cs
- PageBuildProvider.cs
- AppSecurityManager.cs
- AudioStateChangedEventArgs.cs
- HtmlTitle.cs
- PointUtil.cs
- DataGridItemCollection.cs
- DynamicMetaObjectBinder.cs
- XmlDataSourceNodeDescriptor.cs
- DataGridCell.cs
- DatatypeImplementation.cs
- EventArgs.cs
- AttributeEmitter.cs
- DataFormat.cs
- ServiceCredentials.cs
- FixedSOMElement.cs
- DBAsyncResult.cs
- MarkupExtensionParser.cs
- DbConnectionClosed.cs
- EntityDataSourceSelectingEventArgs.cs
- OrderedEnumerableRowCollection.cs
- XPathSingletonIterator.cs
- MaterialCollection.cs
- HttpCookieCollection.cs
- BoundingRectTracker.cs
- UpDownBase.cs
- StaticSiteMapProvider.cs
- RemotingConfiguration.cs
- HyperlinkAutomationPeer.cs
- Polyline.cs
- ToolBarOverflowPanel.cs
- ProviderConnectionPointCollection.cs
- AssemblyResourceLoader.cs
- GenericWebPart.cs
- SkipStoryboardToFill.cs
- Point4DConverter.cs
- ImageSourceValueSerializer.cs
- PrintEvent.cs
- StreamWithDictionary.cs
- X509CertificateValidator.cs
- MsmqOutputChannel.cs
- DataGridAutoFormat.cs
- AffineTransform3D.cs
- FrameworkElementFactory.cs
- Point.cs
- ResourcePermissionBase.cs
- ResourceDescriptionAttribute.cs
- Annotation.cs
- RowTypePropertyElement.cs
- TreeNodeConverter.cs
- filewebrequest.cs
- AvTrace.cs
- SiteMapNodeItem.cs
- TextContainerHelper.cs
- TrustSection.cs
- ErrorStyle.cs
- WpfXamlMember.cs
- RadioButton.cs
- TransformerTypeCollection.cs
- BitmapFrame.cs
- VariantWrapper.cs
- DateTimeOffset.cs
- TransformValueSerializer.cs
- PropertyInfo.cs
- RoutedEvent.cs
- Compilation.cs
- ScheduleChanges.cs
- MultiTouchSystemGestureLogic.cs
- MergePropertyDescriptor.cs
- VideoDrawing.cs
- DataColumnCollection.cs
- ReflectPropertyDescriptor.cs
- GeometryConverter.cs
- Processor.cs
- CreateRefExpr.cs
- XmlSchemas.cs
- UnsafeNetInfoNativeMethods.cs
- BuildResultCache.cs
- EventLogEntryCollection.cs
- Base64Encoding.cs
- RuntimeWrappedException.cs
- FileChangesMonitor.cs
- BindingSourceDesigner.cs
- EncoderReplacementFallback.cs
- SessionStateContainer.cs
- ConsoleCancelEventArgs.cs
- Literal.cs
- MailFileEditor.cs