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
- ProgressBar.cs
- MessageContractExporter.cs
- QilCloneVisitor.cs
- DesignTable.cs
- WebServiceReceive.cs
- FigureParagraph.cs
- StructuralCache.cs
- PagesChangedEventArgs.cs
- RestHandler.cs
- MeasureItemEvent.cs
- HttpWebResponse.cs
- WebPartTransformerAttribute.cs
- InteropExecutor.cs
- UITypeEditor.cs
- FormViewRow.cs
- SimpleMailWebEventProvider.cs
- ObjectContextServiceProvider.cs
- OraclePermission.cs
- CollectionChangedEventManager.cs
- Expression.cs
- DataObjectMethodAttribute.cs
- SqlServices.cs
- ExtractCollection.cs
- ColumnWidthChangedEvent.cs
- Journaling.cs
- ToolStripSplitButton.cs
- DbConnectionHelper.cs
- CounterCreationData.cs
- UriSection.cs
- BaseCAMarshaler.cs
- Label.cs
- WindowsListViewGroup.cs
- PackageRelationshipSelector.cs
- CheckBoxPopupAdapter.cs
- SmtpClient.cs
- LinkUtilities.cs
- SqlNodeAnnotation.cs
- ScriptRegistrationManager.cs
- ConnectionStringsExpressionEditor.cs
- Win32.cs
- SerializationSectionGroup.cs
- ToolStripDropDownButton.cs
- Collection.cs
- XmlQueryType.cs
- InvokeMemberBinder.cs
- Claim.cs
- GroupBox.cs
- InputLanguageSource.cs
- TaskResultSetter.cs
- RbTree.cs
- UrlPath.cs
- ResourceExpressionEditor.cs
- CommandPlan.cs
- DrawingVisual.cs
- StreamingContext.cs
- EntityDataSourceConfigureObjectContext.cs
- ComNativeDescriptor.cs
- Application.cs
- ChildTable.cs
- DbModificationCommandTree.cs
- AsyncCodeActivity.cs
- BooleanToVisibilityConverter.cs
- ListCommandEventArgs.cs
- InputElement.cs
- EntityEntry.cs
- PolygonHotSpot.cs
- SslStream.cs
- ChangeInterceptorAttribute.cs
- ChtmlMobileTextWriter.cs
- LinqExpressionNormalizer.cs
- OrderPreservingPipeliningMergeHelper.cs
- mansign.cs
- InkCanvas.cs
- TextFormatterImp.cs
- GestureRecognizer.cs
- TextShapeableCharacters.cs
- DynamicArgumentDesigner.xaml.cs
- CapabilitiesUse.cs
- DiagnosticTraceSource.cs
- WebCategoryAttribute.cs
- InputLangChangeEvent.cs
- VariantWrapper.cs
- ActivityCodeDomSerializationManager.cs
- MsmqReceiveHelper.cs
- ContextMenuStrip.cs
- DescendentsWalkerBase.cs
- SqlSelectClauseBuilder.cs
- HttpInputStream.cs
- CheckBoxField.cs
- LogLogRecordEnumerator.cs
- ContextMarshalException.cs
- BindableAttribute.cs
- OleDbParameterCollection.cs
- SqlDataSourceQueryConverter.cs
- BindingExpressionBase.cs
- PtsHelper.cs
- TextEditorMouse.cs
- StringExpressionSet.cs
- RequestQueue.cs
- RelativeSource.cs