Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / DataWeb / Server / System / Data / Services / Providers / ResourceAssociationSetEnd.cs / 1305376 / ResourceAssociationSetEnd.cs
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Describes an end point of a resource association set.
//
//
// @owner [....]
//---------------------------------------------------------------------
namespace System.Data.Services.Providers
{
using System.Diagnostics;
///
/// Class to describe an end point of a resource association set.
///
[DebuggerDisplay("ResourceAssociationSetEnd: {Name}: ({ResourceSet.Name}, {ResourceType.Name}, {ResourceProperty.Name})")]
public sealed class ResourceAssociationSetEnd
{
#region Private Fields
///
/// Resource set for the association end.
///
private readonly ResourceSet resourceSet;
///
/// Resource type for the association end.
///
private readonly ResourceType resourceType;
///
/// Resource property for the association end.
///
private readonly ResourceProperty resourceProperty;
#endregion Private Fields
#region Constructor
///
/// Constructs a ResourceAssociationEnd instance.
///
/// Resource set of the association end.
/// Resource type of the association end.
/// Resource property of the association end.
public ResourceAssociationSetEnd(ResourceSet resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
{
WebUtil.CheckArgumentNull(resourceSet, "resourceSet");
WebUtil.CheckArgumentNull(resourceType, "resourceType");
if (resourceProperty != null && (resourceType.TryResolvePropertyName(resourceProperty.Name) == null || resourceProperty.TypeKind != ResourceTypeKind.EntityType))
{
throw new ArgumentException(Strings.ResourceAssociationSetEnd_ResourcePropertyMustBeNavigationPropertyOnResourceType);
}
if (!resourceSet.ResourceType.IsAssignableFrom(resourceType) && !resourceType.IsAssignableFrom(resourceSet.ResourceType))
{
throw new ArgumentException(Strings.ResourceAssociationSetEnd_ResourceTypeMustBeAssignableToResourceSet);
}
this.resourceSet = resourceSet;
this.resourceType = resourceType;
// Note that for the TargetEnd, resourceProperty can be null.
this.resourceProperty = resourceProperty;
}
#endregion Constructor
#region Properties
///
/// Resource set for the association end.
///
public ResourceSet ResourceSet
{
[DebuggerStepThrough]
get { return this.resourceSet; }
}
///
/// Resource type for the association end.
///
public ResourceType ResourceType
{
[DebuggerStepThrough]
get { return this.resourceType; }
}
///
/// Resource property for the association end.
///
public ResourceProperty ResourceProperty
{
[DebuggerStepThrough]
get { return this.resourceProperty; }
}
#endregion Properties
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//----------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Describes an end point of a resource association set.
//
//
// @owner [....]
//---------------------------------------------------------------------
namespace System.Data.Services.Providers
{
using System.Diagnostics;
///
/// Class to describe an end point of a resource association set.
///
[DebuggerDisplay("ResourceAssociationSetEnd: {Name}: ({ResourceSet.Name}, {ResourceType.Name}, {ResourceProperty.Name})")]
public sealed class ResourceAssociationSetEnd
{
#region Private Fields
///
/// Resource set for the association end.
///
private readonly ResourceSet resourceSet;
///
/// Resource type for the association end.
///
private readonly ResourceType resourceType;
///
/// Resource property for the association end.
///
private readonly ResourceProperty resourceProperty;
#endregion Private Fields
#region Constructor
///
/// Constructs a ResourceAssociationEnd instance.
///
/// Resource set of the association end.
/// Resource type of the association end.
/// Resource property of the association end.
public ResourceAssociationSetEnd(ResourceSet resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
{
WebUtil.CheckArgumentNull(resourceSet, "resourceSet");
WebUtil.CheckArgumentNull(resourceType, "resourceType");
if (resourceProperty != null && (resourceType.TryResolvePropertyName(resourceProperty.Name) == null || resourceProperty.TypeKind != ResourceTypeKind.EntityType))
{
throw new ArgumentException(Strings.ResourceAssociationSetEnd_ResourcePropertyMustBeNavigationPropertyOnResourceType);
}
if (!resourceSet.ResourceType.IsAssignableFrom(resourceType) && !resourceType.IsAssignableFrom(resourceSet.ResourceType))
{
throw new ArgumentException(Strings.ResourceAssociationSetEnd_ResourceTypeMustBeAssignableToResourceSet);
}
this.resourceSet = resourceSet;
this.resourceType = resourceType;
// Note that for the TargetEnd, resourceProperty can be null.
this.resourceProperty = resourceProperty;
}
#endregion Constructor
#region Properties
///
/// Resource set for the association end.
///
public ResourceSet ResourceSet
{
[DebuggerStepThrough]
get { return this.resourceSet; }
}
///
/// Resource type for the association end.
///
public ResourceType ResourceType
{
[DebuggerStepThrough]
get { return this.resourceType; }
}
///
/// Resource property for the association end.
///
public ResourceProperty ResourceProperty
{
[DebuggerStepThrough]
get { return this.resourceProperty; }
}
#endregion Properties
}
}
// 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
- ObjectSet.cs
- UiaCoreTypesApi.cs
- NavigationExpr.cs
- SiteMapProvider.cs
- GPPOINT.cs
- SynchronizationContext.cs
- FileVersionInfo.cs
- InitiatorSessionSymmetricMessageSecurityProtocol.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- ServiceObjectContainer.cs
- XmlBufferedByteStreamReader.cs
- ContentDesigner.cs
- DataGridViewCellConverter.cs
- SQLConvert.cs
- WebServiceReceiveDesigner.cs
- Matrix3DStack.cs
- NumberFormatInfo.cs
- HijriCalendar.cs
- UniqueConstraint.cs
- ProfilePropertySettingsCollection.cs
- ShapeTypeface.cs
- MetabaseServerConfig.cs
- EnumDataContract.cs
- TextViewSelectionProcessor.cs
- SizeF.cs
- ApplicationFileCodeDomTreeGenerator.cs
- XmlValidatingReaderImpl.cs
- CookieParameter.cs
- TimeoutTimer.cs
- ContainerParagraph.cs
- WebPartHeaderCloseVerb.cs
- SafeFileMappingHandle.cs
- DataComponentMethodGenerator.cs
- XPathChildIterator.cs
- GeneratedCodeAttribute.cs
- SettingsPropertyCollection.cs
- TableRow.cs
- PackageDigitalSignature.cs
- XpsFixedPageReaderWriter.cs
- XPathChildIterator.cs
- PropertyGridEditorPart.cs
- DecimalAnimationBase.cs
- XmlObjectSerializerWriteContextComplexJson.cs
- SafeMarshalContext.cs
- LockRecoveryTask.cs
- MethodResolver.cs
- CodeIterationStatement.cs
- ObjectConverter.cs
- FunctionDefinition.cs
- XmlWriterTraceListener.cs
- PeerTransportSecurityElement.cs
- CorrelationHandle.cs
- ComponentCache.cs
- DetailsViewDeleteEventArgs.cs
- NamespaceInfo.cs
- HttpResponseMessageProperty.cs
- DataBindingList.cs
- ColorConvertedBitmap.cs
- SafeFileMappingHandle.cs
- IgnoreSectionHandler.cs
- QilStrConcatenator.cs
- ComponentFactoryHelpers.cs
- base64Transforms.cs
- RowUpdatedEventArgs.cs
- cache.cs
- DataPagerField.cs
- UserNameSecurityTokenProvider.cs
- UrlMapping.cs
- InvokeHandlers.cs
- MetadataArtifactLoaderCompositeResource.cs
- TypeConverterHelper.cs
- XamlSerializer.cs
- DataChangedEventManager.cs
- SQLChars.cs
- IPipelineRuntime.cs
- Ops.cs
- EntityDataSourceValidationException.cs
- AdPostCacheSubstitution.cs
- FileDialog.cs
- TemplateAction.cs
- SkipStoryboardToFill.cs
- EllipseGeometry.cs
- PathFigureCollectionConverter.cs
- EventManager.cs
- EventPropertyMap.cs
- ColorBuilder.cs
- ListCommandEventArgs.cs
- FixedTextSelectionProcessor.cs
- Part.cs
- IdnMapping.cs
- LambdaCompiler.Binary.cs
- SharedTcpTransportManager.cs
- ExeConfigurationFileMap.cs
- SizeFConverter.cs
- DiffuseMaterial.cs
- CodeGeneratorOptions.cs
- ServicePoint.cs
- PropertyMapper.cs
- GlyphInfoList.cs
- EncoderParameter.cs