Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / RefType.cs / 3 / 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
- WebSysDescriptionAttribute.cs
- EnumerableCollectionView.cs
- StaticFileHandler.cs
- ToolStripContainer.cs
- BypassElementCollection.cs
- embossbitmapeffect.cs
- AutoSizeComboBox.cs
- TypeBuilderInstantiation.cs
- HostExecutionContextManager.cs
- SiteMapNode.cs
- ItemCheckedEvent.cs
- StaticExtensionConverter.cs
- DataGridViewColumn.cs
- SAPIEngineTypes.cs
- DynamicMethod.cs
- LinkButton.cs
- IProvider.cs
- WindowsFormsLinkLabel.cs
- InstanceNormalEvent.cs
- ContentFilePart.cs
- CaseInsensitiveComparer.cs
- TypeUtils.cs
- StructuredProperty.cs
- DodSequenceMerge.cs
- ScriptControlManager.cs
- ExceptionHandlers.cs
- TextOptions.cs
- ADMembershipUser.cs
- TemplateKeyConverter.cs
- XmlObjectSerializerReadContext.cs
- BamlLocalizableResource.cs
- ISFTagAndGuidCache.cs
- FormViewRow.cs
- ProcessHostConfigUtils.cs
- Rectangle.cs
- RequestContext.cs
- SiteIdentityPermission.cs
- Compilation.cs
- ZipIOExtraFieldZip64Element.cs
- MessageFormatterConverter.cs
- _NetRes.cs
- ColorMap.cs
- ContextMenuService.cs
- WindowsTokenRoleProvider.cs
- AttachInfo.cs
- EditorZone.cs
- NativeMethods.cs
- AlignmentXValidation.cs
- XdrBuilder.cs
- Triplet.cs
- RemoteWebConfigurationHost.cs
- LinkDesigner.cs
- SingleAnimationBase.cs
- WebPartConnectionsCancelEventArgs.cs
- ConfigurationSettings.cs
- ComplexObject.cs
- PointLight.cs
- Base64Decoder.cs
- DataListCommandEventArgs.cs
- HttpProfileBase.cs
- BinaryNode.cs
- _CookieModule.cs
- DataBoundControlAdapter.cs
- ExecutionEngineException.cs
- ScriptReferenceBase.cs
- ObjectDataSourceView.cs
- TimelineClockCollection.cs
- TextEditorParagraphs.cs
- AutomationElementCollection.cs
- MarshalDirectiveException.cs
- NameValueCollection.cs
- SrgsElement.cs
- Stack.cs
- NativeMethods.cs
- FlowDocumentReaderAutomationPeer.cs
- BitmapCodecInfoInternal.cs
- Root.cs
- CheckBoxRenderer.cs
- XmlCharType.cs
- DynamicResourceExtension.cs
- ChangeNode.cs
- WebPartConnectionsCloseVerb.cs
- LambdaExpression.cs
- EllipseGeometry.cs
- DefaultHttpHandler.cs
- ITreeGenerator.cs
- ProfileInfo.cs
- SpeakCompletedEventArgs.cs
- QueryResponse.cs
- Operand.cs
- CustomCategoryAttribute.cs
- XmlLinkedNode.cs
- EventLogEntryCollection.cs
- ImageCollectionCodeDomSerializer.cs
- WindowsPen.cs
- DynamicHyperLink.cs
- TextStore.cs
- ListItemCollection.cs
- WindowInteractionStateTracker.cs
- RoamingStoreFileUtility.cs