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 / AssociationSet.cs / 1 / AssociationSet.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// @owner [....], [....]
//---------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace System.Data.Metadata.Edm
{
///
/// Class for representing an Association set
///
public sealed class AssociationSet : RelationshipSet
{
#region Constructors
///
/// Initializes a new instance of AssocationSet with the given name and the association type
///
/// The name of the Assocation set
/// The association type of the entities that this associationship set type contains
internal AssociationSet(string name, AssociationType associationType)
: base(name, null, null, null, associationType)
{
}
#endregion
#region Fields
private readonly ReadOnlyMetadataCollection _associationSetEnds =
new ReadOnlyMetadataCollection(new MetadataCollection());
#endregion
#region Properties
///
/// Returns the association type associated with this association set
///
public new AssociationType ElementType
{
get
{
return (AssociationType)base.ElementType;
}
}
///
/// Returns the ends of the association set
///
[MetadataProperty(BuiltInTypeKind.AssociationSetEnd, true)]
public ReadOnlyMetadataCollection AssociationSetEnds
{
get
{
return _associationSetEnds;
}
}
///
/// Returns the kind of the type
///
public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.AssociationSet; } }
#endregion
#region Methods
///
/// Sets this item to be readonly, once this is set, the item will never be writable again.
///
internal override void SetReadOnly()
{
if (!this.IsReadOnly)
{
base.SetReadOnly();
this.AssociationSetEnds.Source.SetReadOnly();
}
}
///
/// Adds the given end to the collection of ends
///
///
internal void AddAssociationSetEnd(AssociationSetEnd associationSetEnd)
{
this.AssociationSetEnds.Source.Add(associationSetEnd);
}
#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.Diagnostics;
using System.Text;
namespace System.Data.Metadata.Edm
{
///
/// Class for representing an Association set
///
public sealed class AssociationSet : RelationshipSet
{
#region Constructors
///
/// Initializes a new instance of AssocationSet with the given name and the association type
///
/// The name of the Assocation set
/// The association type of the entities that this associationship set type contains
internal AssociationSet(string name, AssociationType associationType)
: base(name, null, null, null, associationType)
{
}
#endregion
#region Fields
private readonly ReadOnlyMetadataCollection _associationSetEnds =
new ReadOnlyMetadataCollection(new MetadataCollection());
#endregion
#region Properties
///
/// Returns the association type associated with this association set
///
public new AssociationType ElementType
{
get
{
return (AssociationType)base.ElementType;
}
}
///
/// Returns the ends of the association set
///
[MetadataProperty(BuiltInTypeKind.AssociationSetEnd, true)]
public ReadOnlyMetadataCollection AssociationSetEnds
{
get
{
return _associationSetEnds;
}
}
///
/// Returns the kind of the type
///
public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.AssociationSet; } }
#endregion
#region Methods
///
/// Sets this item to be readonly, once this is set, the item will never be writable again.
///
internal override void SetReadOnly()
{
if (!this.IsReadOnly)
{
base.SetReadOnly();
this.AssociationSetEnds.Source.SetReadOnly();
}
}
///
/// Adds the given end to the collection of ends
///
///
internal void AddAssociationSetEnd(AssociationSetEnd associationSetEnd)
{
this.AssociationSetEnds.Source.Add(associationSetEnd);
}
#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
- HttpModuleAction.cs
- SQLInt16.cs
- BinaryCommonClasses.cs
- _AutoWebProxyScriptEngine.cs
- SrgsRuleRef.cs
- RegistryKey.cs
- InputDevice.cs
- BulletedListEventArgs.cs
- IconConverter.cs
- MediaCommands.cs
- CapabilitiesSection.cs
- XmlSchemaAny.cs
- DataGridViewCellStyleConverter.cs
- EmptyEnumerable.cs
- SimpleMailWebEventProvider.cs
- TransportDefaults.cs
- FlowDocumentReaderAutomationPeer.cs
- TypeSchema.cs
- DataSourceXmlSubItemAttribute.cs
- CfgArc.cs
- CustomErrorCollection.cs
- Set.cs
- ActivityCodeDomReferenceService.cs
- ServiceReference.cs
- MouseButtonEventArgs.cs
- Stream.cs
- PropertyKey.cs
- HtmlHistory.cs
- SqlMethodCallConverter.cs
- HttpListenerRequestUriBuilder.cs
- Accessible.cs
- Literal.cs
- DeferredElementTreeState.cs
- InputReport.cs
- PeerCollaborationPermission.cs
- ScriptMethodAttribute.cs
- XmlSerializableWriter.cs
- VariantWrapper.cs
- TreeView.cs
- GenericWebPart.cs
- MetadataUtil.cs
- GridViewDeletedEventArgs.cs
- DataService.cs
- MemberRelationshipService.cs
- WebScriptClientGenerator.cs
- HttpPostedFile.cs
- DataGridViewColumnConverter.cs
- IssuanceLicense.cs
- SetStoryboardSpeedRatio.cs
- SiteOfOriginPart.cs
- SmtpNegotiateAuthenticationModule.cs
- Renderer.cs
- PropertyRecord.cs
- Menu.cs
- TextEffectCollection.cs
- FixedSOMElement.cs
- HandoffBehavior.cs
- ManipulationInertiaStartingEventArgs.cs
- SHA384Managed.cs
- RealizationDrawingContextWalker.cs
- RequestCachingSection.cs
- XamlSerializationHelper.cs
- HttpResponseHeader.cs
- Util.cs
- WebRequest.cs
- ComNativeDescriptor.cs
- mil_commands.cs
- ListSortDescriptionCollection.cs
- RandomNumberGenerator.cs
- IChannel.cs
- WebRequestModuleElement.cs
- PkcsMisc.cs
- XmlSchemaSubstitutionGroup.cs
- MILUtilities.cs
- EventLogPermission.cs
- Splitter.cs
- PauseStoryboard.cs
- GenericsInstances.cs
- ServicesUtilities.cs
- PersonalizationProvider.cs
- COM2FontConverter.cs
- SymbolMethod.cs
- CapabilitiesSection.cs
- MultiPageTextView.cs
- URLIdentityPermission.cs
- ListenerSessionConnection.cs
- DrawingAttributeSerializer.cs
- ObjectDataSourceDisposingEventArgs.cs
- _ShellExpression.cs
- _LocalDataStoreMgr.cs
- CommandSet.cs
- DbParameterHelper.cs
- Visitor.cs
- RequestQueue.cs
- BlobPersonalizationState.cs
- MobileContainerDesigner.cs
- NullReferenceException.cs
- ParameterBinding.cs
- xdrvalidator.cs
- VarRemapper.cs