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
- DictionaryItemsCollection.cs
- Util.cs
- PassportAuthentication.cs
- IconConverter.cs
- safelinkcollection.cs
- StickyNoteAnnotations.cs
- ImageClickEventArgs.cs
- SerializationException.cs
- ExpressionBindingCollection.cs
- RelatedEnd.cs
- XamlTypeMapper.cs
- AppModelKnownContentFactory.cs
- Switch.cs
- RunWorkerCompletedEventArgs.cs
- Visitor.cs
- RightsManagementInformation.cs
- SemanticResultKey.cs
- QueryTask.cs
- ImageSourceValueSerializer.cs
- Collection.cs
- SwitchElementsCollection.cs
- OutputCacheProfileCollection.cs
- ObjectDataSourceView.cs
- WindowsToolbarItemAsMenuItem.cs
- Oci.cs
- SerializeAbsoluteContext.cs
- FrameworkObject.cs
- Base64Encoding.cs
- DataGridViewColumnHeaderCell.cs
- ToolStripMenuItem.cs
- RuleElement.cs
- TreeNodeConverter.cs
- Visitors.cs
- DashStyles.cs
- ApplicationSettingsBase.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- PerformanceCountersElement.cs
- PerspectiveCamera.cs
- DataGridViewTextBoxColumn.cs
- NameValueFileSectionHandler.cs
- EnlistmentState.cs
- RectValueSerializer.cs
- PixelShader.cs
- RuleCache.cs
- Root.cs
- Types.cs
- MethodInfo.cs
- BufferBuilder.cs
- DataControlImageButton.cs
- BaseTransportHeaders.cs
- TouchFrameEventArgs.cs
- RegistrationProxy.cs
- DataServiceContext.cs
- LogStore.cs
- PassportAuthenticationEventArgs.cs
- ArgumentReference.cs
- ValidationSummary.cs
- Parser.cs
- XmlSchemaException.cs
- SecureStringHasher.cs
- SchemaCompiler.cs
- DataSourceHelper.cs
- TraceUtility.cs
- HMAC.cs
- LicenseManager.cs
- ConfigXmlCDataSection.cs
- NameValuePair.cs
- FlowLayoutSettings.cs
- ProfileBuildProvider.cs
- ComponentManagerBroker.cs
- SynchronizationValidator.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- Size.cs
- XmlValueConverter.cs
- LifetimeServices.cs
- RangeBase.cs
- TimelineClockCollection.cs
- CacheMemory.cs
- CheckoutException.cs
- LinqDataSourceInsertEventArgs.cs
- FixedSOMTable.cs
- RequestNavigateEventArgs.cs
- Object.cs
- Int16AnimationBase.cs
- CustomAssemblyResolver.cs
- EntryWrittenEventArgs.cs
- BasicExpressionVisitor.cs
- HijriCalendar.cs
- WindowPattern.cs
- TypeForwardedToAttribute.cs
- NonBatchDirectoryCompiler.cs
- Int16.cs
- ColumnResizeAdorner.cs
- CodeObject.cs
- _LoggingObject.cs
- XmlSchemaGroupRef.cs
- TrackingStringDictionary.cs
- SocketException.cs
- X509SecurityToken.cs
- ServiceModelSecurityTokenTypes.cs