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
- ArrangedElementCollection.cs
- ExceptionHandlers.cs
- LayoutInformation.cs
- EllipseGeometry.cs
- Size.cs
- FrameworkContentElement.cs
- CellParagraph.cs
- EnumValAlphaComparer.cs
- XmlBindingWorker.cs
- TextAdaptor.cs
- ValidateNames.cs
- _ProxyChain.cs
- XMLSyntaxException.cs
- ChtmlLinkAdapter.cs
- OleDbParameter.cs
- BinaryKeyIdentifierClause.cs
- FontNameEditor.cs
- TransformerInfo.cs
- NetSectionGroup.cs
- Helper.cs
- ResolveMatchesMessage11.cs
- TextFormatter.cs
- Soap12ServerProtocol.cs
- TextEditorTyping.cs
- ColorAnimationUsingKeyFrames.cs
- WebPartTracker.cs
- DrawingGroup.cs
- TextTreeText.cs
- Process.cs
- DataColumnChangeEvent.cs
- AppSettingsExpressionBuilder.cs
- CollectionView.cs
- AutoGeneratedFieldProperties.cs
- NamedElement.cs
- ParseHttpDate.cs
- ClaimTypes.cs
- MetabaseServerConfig.cs
- SatelliteContractVersionAttribute.cs
- ScriptModule.cs
- WorkflowNamespace.cs
- DesignerAttributeInfo.cs
- SQLRoleProvider.cs
- WebUtil.cs
- StylusPointPropertyInfoDefaults.cs
- TypeSystem.cs
- SoapMessage.cs
- PeerPresenceInfo.cs
- RuntimeArgumentHandle.cs
- SafeNativeMethods.cs
- WebZoneDesigner.cs
- TreeNodeSelectionProcessor.cs
- WizardStepBase.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- Stream.cs
- TogglePattern.cs
- DebugView.cs
- RangeValuePattern.cs
- RC2.cs
- OpenFileDialog.cs
- ProfileGroupSettingsCollection.cs
- CmsUtils.cs
- LogicalExpr.cs
- HttpGetServerProtocol.cs
- ConnectionStringSettings.cs
- InkCanvasSelection.cs
- Timer.cs
- ConfigurationConverterBase.cs
- MemberRestriction.cs
- WmlControlAdapter.cs
- MessageQueueKey.cs
- Types.cs
- Point3DAnimationBase.cs
- DataGridViewCellStyleConverter.cs
- CodeTypeDeclarationCollection.cs
- RtfFormatStack.cs
- ColumnMapProcessor.cs
- FontDifferentiator.cs
- ScriptDescriptor.cs
- ModelTreeManager.cs
- Point3D.cs
- mactripleDES.cs
- FieldTemplateFactory.cs
- SemanticResultKey.cs
- ClientApiGenerator.cs
- NonVisualControlAttribute.cs
- StrokeFIndices.cs
- ColorBlend.cs
- Bold.cs
- NetTcpSectionData.cs
- ActivityStatusChangeEventArgs.cs
- ItemPager.cs
- KeyFrames.cs
- CompressedStack.cs
- GlobalEventManager.cs
- ParserContext.cs
- DataGridViewCellCollection.cs
- ProtocolsInstallComponent.cs
- TargetException.cs
- Int16KeyFrameCollection.cs
- MultipleViewProviderWrapper.cs