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
- UniqueIdentifierService.cs
- StdValidatorsAndConverters.cs
- WeakReferenceList.cs
- BaseTemplateCodeDomTreeGenerator.cs
- HMACSHA256.cs
- DecimalFormatter.cs
- Path.cs
- DataGridViewCellValueEventArgs.cs
- DataColumnCollection.cs
- HtmlToClrEventProxy.cs
- AuthorizationRule.cs
- FormatPage.cs
- FixUpCollection.cs
- SchemaMerger.cs
- ToolStripItemRenderEventArgs.cs
- StreamGeometry.cs
- PackWebResponse.cs
- ProgressBarAutomationPeer.cs
- SmiEventSink.cs
- TypedTableHandler.cs
- ScriptReference.cs
- CodeDirectionExpression.cs
- PolyBezierSegmentFigureLogic.cs
- FamilyMap.cs
- BrowserCapabilitiesFactoryBase.cs
- DateTimeParse.cs
- AllMembershipCondition.cs
- TokenBasedSetEnumerator.cs
- DictionaryBase.cs
- ScriptingWebServicesSectionGroup.cs
- DesignerCategoryAttribute.cs
- FillBehavior.cs
- ActivityCodeDomSerializer.cs
- NameValueConfigurationCollection.cs
- DbQueryCommandTree.cs
- ComAdminWrapper.cs
- SqlException.cs
- HttpRequestBase.cs
- Stack.cs
- AVElementHelper.cs
- WindowsTreeView.cs
- DocumentXPathNavigator.cs
- Events.cs
- JoinGraph.cs
- InputReferenceExpression.cs
- EndEvent.cs
- AdvancedBindingEditor.cs
- HtmlTernaryTree.cs
- ViewGenResults.cs
- ResolveMatchesCD1.cs
- HuffmanTree.cs
- HttpCookiesSection.cs
- ReadOnlyAttribute.cs
- GeometryConverter.cs
- KeyboardEventArgs.cs
- HttpSysSettings.cs
- ProviderBase.cs
- NativeActivityFaultContext.cs
- ObjectViewFactory.cs
- TypeReference.cs
- RoutedPropertyChangedEventArgs.cs
- DataGridSortCommandEventArgs.cs
- PrintPageEvent.cs
- NodeFunctions.cs
- TransformationRules.cs
- ObjectTypeMapping.cs
- xmlfixedPageInfo.cs
- WindowsScrollBar.cs
- ClientOptions.cs
- EUCJPEncoding.cs
- MailWebEventProvider.cs
- ListViewDeleteEventArgs.cs
- AssemblyAttributes.cs
- PropertySourceInfo.cs
- HtmlEncodedRawTextWriter.cs
- VBIdentifierNameEditor.cs
- DependencyObjectCodeDomSerializer.cs
- ClassicBorderDecorator.cs
- TableRowGroup.cs
- DataGridViewRowEventArgs.cs
- XmlDataSourceNodeDescriptor.cs
- Crc32.cs
- AssemblyAttributesGoHere.cs
- PersonalizableTypeEntry.cs
- XmlWrappingReader.cs
- NativeMethodsOther.cs
- BooleanConverter.cs
- TextInfo.cs
- IdnElement.cs
- PermissionToken.cs
- NewExpression.cs
- MemberCollection.cs
- NonBatchDirectoryCompiler.cs
- WebBrowserContainer.cs
- StoragePropertyMapping.cs
- SessionStateModule.cs
- LoginDesignerUtil.cs
- TextBoxAutoCompleteSourceConverter.cs
- TextDecorations.cs
- Oid.cs