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
- ToolStripSeparator.cs
- TreeNode.cs
- xmlglyphRunInfo.cs
- BypassElementCollection.cs
- linebase.cs
- Site.cs
- InternalBase.cs
- RoleServiceManager.cs
- ConfigurationProperty.cs
- Brushes.cs
- XmlTextWriter.cs
- FlowDocumentScrollViewerAutomationPeer.cs
- XmlNodeList.cs
- XmlAtomicValue.cs
- NamespaceCollection.cs
- SortedDictionary.cs
- TraceSwitch.cs
- SparseMemoryStream.cs
- Line.cs
- SystemNetHelpers.cs
- SqlUdtInfo.cs
- BlockUIContainer.cs
- XamlTypeMapper.cs
- ContainerControlDesigner.cs
- ProcessHost.cs
- ItemTypeToolStripMenuItem.cs
- SimpleApplicationHost.cs
- StringFreezingAttribute.cs
- RegexWriter.cs
- TextBoxLine.cs
- ContextConfiguration.cs
- FontStyleConverter.cs
- WindowsListViewSubItem.cs
- TreeViewEvent.cs
- SurrogateChar.cs
- XmlReflectionMember.cs
- BindingSource.cs
- XmlDocument.cs
- RoleServiceManager.cs
- CursorConverter.cs
- Overlapped.cs
- NetStream.cs
- AndCondition.cs
- SQLDoubleStorage.cs
- RichTextBoxConstants.cs
- GenerateHelper.cs
- Compensation.cs
- ResXFileRef.cs
- DayRenderEvent.cs
- WorkflowOperationBehavior.cs
- SystemMulticastIPAddressInformation.cs
- SharedRuntimeState.cs
- LineServicesCallbacks.cs
- ReferentialConstraint.cs
- CodeMemberEvent.cs
- DomainLiteralReader.cs
- CultureSpecificCharacterBufferRange.cs
- SessionSwitchEventArgs.cs
- OpenFileDialog.cs
- ImageProxy.cs
- Decorator.cs
- InsufficientMemoryException.cs
- BitmapDecoder.cs
- CriticalExceptions.cs
- FileEnumerator.cs
- TdsValueSetter.cs
- BuildProviderAppliesToAttribute.cs
- ObservableCollection.cs
- Pair.cs
- RoleGroup.cs
- EntityConnectionStringBuilder.cs
- TreeViewImageIndexConverter.cs
- ContractMapping.cs
- SignatureDescription.cs
- WebPartMenuStyle.cs
- NegotiateStream.cs
- MobileComponentEditorPage.cs
- RelationshipEntry.cs
- NumberFormatInfo.cs
- TrackBarRenderer.cs
- PrintDialogException.cs
- SizeChangedInfo.cs
- MenuCommand.cs
- RecognitionEventArgs.cs
- COM2IDispatchConverter.cs
- ExtendedProtectionPolicy.cs
- CodeSnippetTypeMember.cs
- SigningDialog.cs
- ConstructorNeedsTagAttribute.cs
- _ProxyChain.cs
- SqlProfileProvider.cs
- MediaPlayerState.cs
- CodeCatchClause.cs
- TraceAsyncResult.cs
- SetIterators.cs
- HttpCachePolicy.cs
- XmlCodeExporter.cs
- XPathSelfQuery.cs
- OdbcStatementHandle.cs
- WebPartManagerInternals.cs