Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / ndp / fx / src / DataEntity / System / Data / Metadata / Edm / AssociationSetEnd.cs / 1 / AssociationSetEnd.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 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 [....], [....] //--------------------------------------------------------------------- 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
- CfgParser.cs
- DataRowComparer.cs
- Axis.cs
- ReflectionServiceProvider.cs
- ColumnClickEvent.cs
- UserControlCodeDomTreeGenerator.cs
- WrappingXamlSchemaContext.cs
- CompilerGeneratedAttribute.cs
- COM2ExtendedTypeConverter.cs
- DiscoveryClientRequestChannel.cs
- PageSetupDialog.cs
- RoutingSection.cs
- ObjectAnimationUsingKeyFrames.cs
- WsdlInspector.cs
- ObjectCloneHelper.cs
- ISAPIWorkerRequest.cs
- WrappedIUnknown.cs
- SByteStorage.cs
- FixedFlowMap.cs
- AnnotationHelper.cs
- LongAverageAggregationOperator.cs
- WindowsImpersonationContext.cs
- CodeArgumentReferenceExpression.cs
- Debug.cs
- TypeTypeConverter.cs
- DirectoryNotFoundException.cs
- NumericUpDown.cs
- XPathNodeInfoAtom.cs
- DataBinding.cs
- sqlmetadatafactory.cs
- VersionConverter.cs
- QuarticEase.cs
- _UriSyntax.cs
- CSharpCodeProvider.cs
- NavigationWindow.cs
- DbConnectionClosed.cs
- FunctionNode.cs
- OrderedDictionary.cs
- XslCompiledTransform.cs
- ManagementObject.cs
- LinearGradientBrush.cs
- BitmapEffectDrawingContent.cs
- StatusBarPanel.cs
- SparseMemoryStream.cs
- TreeNodeEventArgs.cs
- ObjectSecurity.cs
- TimelineClockCollection.cs
- ApplicationException.cs
- TransportManager.cs
- MetafileHeader.cs
- StateBag.cs
- TrackingAnnotationCollection.cs
- MatrixTransform3D.cs
- ComponentFactoryHelpers.cs
- PrivilegeNotHeldException.cs
- ProtocolsConfigurationEntry.cs
- mactripleDES.cs
- CacheEntry.cs
- ChannelSinkStacks.cs
- SignatureResourcePool.cs
- StringFunctions.cs
- ControlDesigner.cs
- RemotingConfiguration.cs
- WindowsListView.cs
- Timer.cs
- RegexCapture.cs
- ComboBoxItem.cs
- DbConnectionInternal.cs
- TypeUnloadedException.cs
- InputLanguage.cs
- RawAppCommandInputReport.cs
- SequentialOutput.cs
- _TransmitFileOverlappedAsyncResult.cs
- AxisAngleRotation3D.cs
- DataGridViewColumnDesigner.cs
- ListControlStringCollectionEditor.cs
- CrossSiteScriptingValidation.cs
- ToolStripTextBox.cs
- ParameterBinding.cs
- basenumberconverter.cs
- LineVisual.cs
- CornerRadius.cs
- ToolStripContainerActionList.cs
- LayoutEditorPart.cs
- ModelVisual3D.cs
- ValidationRuleCollection.cs
- DelayedRegex.cs
- ReaderWriterLock.cs
- CompModSwitches.cs
- GcHandle.cs
- LinqDataSourceValidationException.cs
- ReferencedCollectionType.cs
- XmlC14NWriter.cs
- AllMembershipCondition.cs
- TransformGroup.cs
- BaseTemplateCodeDomTreeGenerator.cs
- FormatterServicesNoSerializableCheck.cs
- SecurityState.cs
- ComplexObject.cs
- AbandonedMutexException.cs