Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / ndp / fx / src / DataEntity / System / Data / EntityModel / SchemaObjectModel / KeyProperty.cs / 2 / KeyProperty.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....]
// @backupOwner [....]
//---------------------------------------------------------------------
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Data.Metadata.Edm;
namespace System.Data.EntityModel.SchemaObjectModel
{
///
/// Represents PropertyRef Element for Entity keys and referential constraints
///
internal sealed class PropertyRefElement : SchemaElement
{
#region Instance Fields
private StructuredProperty _property = null;
#endregion
#region Public Methods
///
/// construct a KeyProperty object
///
///
public PropertyRefElement(SchemaElement parentElement)
: base(parentElement)
{
}
#endregion
#region Public Properties
///
/// property chain from KeyedType to Leaf property
///
public StructuredProperty Property
{
get
{
return _property;
}
}
#endregion
#region Private Methods
internal override void ResolveTopLevelNames()
{
Debug.Assert(false, "This method should never be used. Use other overload instead");
}
///
/// Since this method can be used in different context, this method does not add any errors
/// Please make sure that the caller of this methods handles the error case and add errors
/// appropriately
///
///
///
internal bool ResolveNames(SchemaEntityType entityType)
{
if (string.IsNullOrEmpty(this.Name))
{
// Don't flag this error. This must already must have flaged as error, while handling name attribute
return true;
}
// Make sure there is a property by this name
_property = entityType.FindProperty(this.Name);
return (_property != null);
}
#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;
using System.Collections.Generic;
using System.Diagnostics;
using System.Data.Metadata.Edm;
namespace System.Data.EntityModel.SchemaObjectModel
{
///
/// Represents PropertyRef Element for Entity keys and referential constraints
///
internal sealed class PropertyRefElement : SchemaElement
{
#region Instance Fields
private StructuredProperty _property = null;
#endregion
#region Public Methods
///
/// construct a KeyProperty object
///
///
public PropertyRefElement(SchemaElement parentElement)
: base(parentElement)
{
}
#endregion
#region Public Properties
///
/// property chain from KeyedType to Leaf property
///
public StructuredProperty Property
{
get
{
return _property;
}
}
#endregion
#region Private Methods
internal override void ResolveTopLevelNames()
{
Debug.Assert(false, "This method should never be used. Use other overload instead");
}
///
/// Since this method can be used in different context, this method does not add any errors
/// Please make sure that the caller of this methods handles the error case and add errors
/// appropriately
///
///
///
internal bool ResolveNames(SchemaEntityType entityType)
{
if (string.IsNullOrEmpty(this.Name))
{
// Don't flag this error. This must already must have flaged as error, while handling name attribute
return true;
}
// Make sure there is a property by this name
_property = entityType.FindProperty(this.Name);
return (_property != null);
}
#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
- GetIndexBinder.cs
- dataprotectionpermission.cs
- DES.cs
- EntryWrittenEventArgs.cs
- TagPrefixInfo.cs
- SqlWriter.cs
- HtmlShim.cs
- QueryInterceptorAttribute.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- DesignTimeVisibleAttribute.cs
- XsltOutput.cs
- OAVariantLib.cs
- FormViewUpdatedEventArgs.cs
- ThreadAbortException.cs
- JournalEntryListConverter.cs
- HttpTransportBindingElement.cs
- CatalogPart.cs
- SqlConnectionPoolGroupProviderInfo.cs
- CodeObjectCreateExpression.cs
- QuaternionRotation3D.cs
- ReliableDuplexSessionChannel.cs
- Expression.DebuggerProxy.cs
- DesignerView.Commands.cs
- PropertyChangingEventArgs.cs
- SafeSecurityHelper.cs
- TreeViewEvent.cs
- PassportAuthenticationEventArgs.cs
- IntegrationExceptionEventArgs.cs
- PropertyMetadata.cs
- Range.cs
- SettingsPropertyIsReadOnlyException.cs
- OrderedDictionaryStateHelper.cs
- AssertFilter.cs
- SystemSounds.cs
- DataGridViewUtilities.cs
- ComboBoxRenderer.cs
- HealthMonitoringSection.cs
- CodeTypeMember.cs
- TextElementEnumerator.cs
- CorrelationManager.cs
- ConnectionStringEditor.cs
- ContentPresenter.cs
- SettingsPropertyIsReadOnlyException.cs
- RadioButtonRenderer.cs
- WmpBitmapEncoder.cs
- SamlSubject.cs
- WhitespaceRuleReader.cs
- ExpressionVisitor.cs
- listitem.cs
- MarshalByValueComponent.cs
- AcceleratedTokenProvider.cs
- GridViewRowEventArgs.cs
- LicenseProviderAttribute.cs
- XmlAttribute.cs
- SqlRewriteScalarSubqueries.cs
- StylusOverProperty.cs
- AssertUtility.cs
- ADMembershipUser.cs
- OrderedDictionary.cs
- CodeMethodReturnStatement.cs
- TrackingProfileCache.cs
- UntypedNullExpression.cs
- KeyGestureConverter.cs
- SafeRightsManagementPubHandle.cs
- WmlListAdapter.cs
- ParseChildrenAsPropertiesAttribute.cs
- Ray3DHitTestResult.cs
- PropertyChangingEventArgs.cs
- ScrollBar.cs
- Token.cs
- ApplicationTrust.cs
- CompiledXpathExpr.cs
- UriExt.cs
- DataGridHeadersVisibilityToVisibilityConverter.cs
- UnitySerializationHolder.cs
- StorageBasedPackageProperties.cs
- FormatConvertedBitmap.cs
- ConversionContext.cs
- IndexingContentUnit.cs
- WebPartActionVerb.cs
- IgnoreFileBuildProvider.cs
- PointLightBase.cs
- BlurEffect.cs
- PeerNameRecordCollection.cs
- BinaryParser.cs
- ElementProxy.cs
- _UncName.cs
- LocalizableAttribute.cs
- FormViewRow.cs
- ToolStripMenuItemDesigner.cs
- BufferedGraphics.cs
- TableSectionStyle.cs
- GPRECT.cs
- AllMembershipCondition.cs
- PackageDigitalSignatureManager.cs
- DataGridGeneralPage.cs
- CommandExpr.cs
- WindowPattern.cs
- PersonalizationProviderCollection.cs
- RowVisual.cs