Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / AssociationSetEnd.cs / 1305376 / AssociationSetEnd.cs
//---------------------------------------------------------------------- //// Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner [....] // @backupOwner [....] //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; using System.Text; namespace System.Data.Metadata.Edm { ////// Class representing a AssociationSet End /// public sealed class AssociationSetEnd : MetadataItem { #region Constructors ////// Initializes a new instance of AssocationSetEnd /// /// Entity set that this end refers to /// The association set which this belongs to /// The end member of the association set which this is an instance of ///Thrown if either the role,entitySet, parentSet or endMember arguments are null internal AssociationSetEnd(EntitySet entitySet, AssociationSet parentSet, AssociationEndMember endMember) { _entitySet = EntityUtil.GenericCheckArgumentNull(entitySet, "entitySet"); _parentSet = EntityUtil.GenericCheckArgumentNull(parentSet, "parentSet"); _endMember = EntityUtil.GenericCheckArgumentNull(endMember, "endMember"); } #endregion #region Fields private readonly EntitySet _entitySet; private readonly AssociationSet _parentSet; private readonly AssociationEndMember _endMember; #endregion #region Properties ////// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.AssociationSetEnd; } } ////// The parent association set for this AssociationSetEnd. /// ///Thrown if the value passed in for the setter is null ///Thrown if Setter is called when the AssociationSetEnd instance is in ReadOnly state [MetadataProperty(BuiltInTypeKind.AssociationSet, false)] public AssociationSet ParentAssociationSet { get { return _parentSet; } } ////// The EndMember which this AssociationSetEnd corresponds to. /// ///Thrown if the value passed in for the setter is null ///Thrown if Setter is called when the AssociationSetEnd instance is in ReadOnly state [MetadataProperty(BuiltInTypeKind.AssociationEndMember, false)] public AssociationEndMember CorrespondingAssociationEndMember { get { return _endMember; } } ////// Name of the end /// [MetadataProperty(PrimitiveTypeKind.String, false)] public string Name { get { return CorrespondingAssociationEndMember.Name; } } ////// Name of the end role /// ///Thrown if the value passed in for the setter is null ///Thrown if Setter is called when the AssociationSetEnd instance is in ReadOnly state [MetadataProperty(PrimitiveTypeKind.String, false)] [Obsolete("This property is going away, please use the Name property instead")] public string Role { get { return Name; } } ////// Returns the entity set referred by this end role /// [MetadataProperty(BuiltInTypeKind.EntitySet, false)] public EntitySet EntitySet { get { return _entitySet; } } ////// Gets the identity of this item /// internal override string Identity { get { return this.Name; } } #endregion #region Methods ////// Overriding System.Object.ToString to provide better String representation /// for this type. /// public override string ToString() { return Name; } ////// Sets this item to be readonly, once this is set, the item will never be writable again. /// internal override void SetReadOnly() { if (!IsReadOnly) { base.SetReadOnly(); AssociationSet parentAssociationSet = ParentAssociationSet; if (parentAssociationSet != null) { parentAssociationSet.SetReadOnly(); } AssociationEndMember endMember = CorrespondingAssociationEndMember; if (endMember != null) { endMember.SetReadOnly(); } EntitySet entitySet = EntitySet; if (entitySet != null) { entitySet.SetReadOnly(); } } } #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.Generic; using System.Data.Common; using System.Text; namespace System.Data.Metadata.Edm { ////// Class representing a AssociationSet End /// public sealed class AssociationSetEnd : MetadataItem { #region Constructors ////// Initializes a new instance of AssocationSetEnd /// /// Entity set that this end refers to /// The association set which this belongs to /// The end member of the association set which this is an instance of ///Thrown if either the role,entitySet, parentSet or endMember arguments are null internal AssociationSetEnd(EntitySet entitySet, AssociationSet parentSet, AssociationEndMember endMember) { _entitySet = EntityUtil.GenericCheckArgumentNull(entitySet, "entitySet"); _parentSet = EntityUtil.GenericCheckArgumentNull(parentSet, "parentSet"); _endMember = EntityUtil.GenericCheckArgumentNull(endMember, "endMember"); } #endregion #region Fields private readonly EntitySet _entitySet; private readonly AssociationSet _parentSet; private readonly AssociationEndMember _endMember; #endregion #region Properties ////// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.AssociationSetEnd; } } ////// The parent association set for this AssociationSetEnd. /// ///Thrown if the value passed in for the setter is null ///Thrown if Setter is called when the AssociationSetEnd instance is in ReadOnly state [MetadataProperty(BuiltInTypeKind.AssociationSet, false)] public AssociationSet ParentAssociationSet { get { return _parentSet; } } ////// The EndMember which this AssociationSetEnd corresponds to. /// ///Thrown if the value passed in for the setter is null ///Thrown if Setter is called when the AssociationSetEnd instance is in ReadOnly state [MetadataProperty(BuiltInTypeKind.AssociationEndMember, false)] public AssociationEndMember CorrespondingAssociationEndMember { get { return _endMember; } } ////// Name of the end /// [MetadataProperty(PrimitiveTypeKind.String, false)] public string Name { get { return CorrespondingAssociationEndMember.Name; } } ////// Name of the end role /// ///Thrown if the value passed in for the setter is null ///Thrown if Setter is called when the AssociationSetEnd instance is in ReadOnly state [MetadataProperty(PrimitiveTypeKind.String, false)] [Obsolete("This property is going away, please use the Name property instead")] public string Role { get { return Name; } } ////// Returns the entity set referred by this end role /// [MetadataProperty(BuiltInTypeKind.EntitySet, false)] public EntitySet EntitySet { get { return _entitySet; } } ////// Gets the identity of this item /// internal override string Identity { get { return this.Name; } } #endregion #region Methods ////// Overriding System.Object.ToString to provide better String representation /// for this type. /// public override string ToString() { return Name; } ////// Sets this item to be readonly, once this is set, the item will never be writable again. /// internal override void SetReadOnly() { if (!IsReadOnly) { base.SetReadOnly(); AssociationSet parentAssociationSet = ParentAssociationSet; if (parentAssociationSet != null) { parentAssociationSet.SetReadOnly(); } AssociationEndMember endMember = CorrespondingAssociationEndMember; if (endMember != null) { endMember.SetReadOnly(); } EntitySet entitySet = EntitySet; if (entitySet != null) { entitySet.SetReadOnly(); } } } #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
- Reference.cs
- ControlCollection.cs
- QueryableDataSourceView.cs
- WpfPayload.cs
- XmlILConstructAnalyzer.cs
- Rect3D.cs
- VisualBrush.cs
- WebControlsSection.cs
- CatalogPart.cs
- TraceRecord.cs
- RawStylusInputReport.cs
- MessageEnumerator.cs
- CanExecuteRoutedEventArgs.cs
- SqlCommandBuilder.cs
- TdsParserHelperClasses.cs
- CalloutQueueItem.cs
- BmpBitmapEncoder.cs
- TextProviderWrapper.cs
- SeparatorAutomationPeer.cs
- InstallerTypeAttribute.cs
- ParameterModifier.cs
- CatchDesigner.xaml.cs
- CompilerHelpers.cs
- DataGridCellInfo.cs
- ContainsSearchOperator.cs
- HttpCookieCollection.cs
- Stack.cs
- RequestCachingSection.cs
- BinaryWriter.cs
- DeferredElementTreeState.cs
- DispatchChannelSink.cs
- GenericTextProperties.cs
- SecuritySessionSecurityTokenAuthenticator.cs
- BaseProcessor.cs
- MarshalByRefObject.cs
- CapabilitiesUse.cs
- TreeViewItemAutomationPeer.cs
- XPathChildIterator.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- HtmlTableRow.cs
- FrameDimension.cs
- ProfileSettingsCollection.cs
- RandomNumberGenerator.cs
- FileLoadException.cs
- COM2PropertyDescriptor.cs
- MatrixValueSerializer.cs
- Send.cs
- DesignTimeTemplateParser.cs
- DataServiceConfiguration.cs
- MaterialGroup.cs
- ActivityPreviewDesigner.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- ScrollChrome.cs
- datacache.cs
- SchemaComplexType.cs
- CollectionViewGroupInternal.cs
- MetadataFile.cs
- QilSortKey.cs
- ValidatedMobileControlConverter.cs
- RelationshipManager.cs
- FlowLayout.cs
- codemethodreferenceexpression.cs
- NestPullup.cs
- ExtendedProperty.cs
- MasterPageBuildProvider.cs
- LayoutInformation.cs
- SqlReferenceCollection.cs
- ListControl.cs
- ProviderSettings.cs
- LinearQuaternionKeyFrame.cs
- InputQueue.cs
- XmlSequenceWriter.cs
- Collection.cs
- path.cs
- MethodRental.cs
- PrintEvent.cs
- OpCellTreeNode.cs
- BitmapDownload.cs
- InstanceCollisionException.cs
- ComboBoxAutomationPeer.cs
- Soap12ServerProtocol.cs
- ItemCheckedEvent.cs
- DataGridViewTopLeftHeaderCell.cs
- SecurityException.cs
- DesignerToolStripControlHost.cs
- SqlDependencyUtils.cs
- SettingsPropertyValueCollection.cs
- EFDataModelProvider.cs
- ProgressBarHighlightConverter.cs
- documentation.cs
- SetStateDesigner.cs
- CompositeActivityMarkupSerializer.cs
- SharedStatics.cs
- AstTree.cs
- StandardBindingElement.cs
- ConnectionInterfaceCollection.cs
- BaseInfoTable.cs
- ConfigXmlWhitespace.cs
- StateMachineSubscription.cs
- MouseOverProperty.cs