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
- Rules.cs
- InputLangChangeRequestEvent.cs
- ParagraphVisual.cs
- dbdatarecord.cs
- ToolStripRenderEventArgs.cs
- InitialServerConnectionReader.cs
- CanonicalizationDriver.cs
- ProfessionalColors.cs
- HttpRuntimeSection.cs
- ToolStripItemRenderEventArgs.cs
- PassportAuthentication.cs
- ContainerFilterService.cs
- Aes.cs
- RangeBaseAutomationPeer.cs
- WebPartCatalogCloseVerb.cs
- HttpStreamFormatter.cs
- DragDropManager.cs
- DesignerOptionService.cs
- OAVariantLib.cs
- CompModSwitches.cs
- RegexTree.cs
- Image.cs
- GeneralTransform3DCollection.cs
- COM2Properties.cs
- Pkcs9Attribute.cs
- diagnosticsswitches.cs
- InputElement.cs
- ServiceOperation.cs
- SchemaObjectWriter.cs
- DataServiceStreamResponse.cs
- GroupQuery.cs
- DeobfuscatingStream.cs
- ObjectView.cs
- WebResourceUtil.cs
- HtmlInputFile.cs
- OuterGlowBitmapEffect.cs
- FieldAccessException.cs
- Point3DConverter.cs
- ReadOnlyCollection.cs
- TraceHandlerErrorFormatter.cs
- DropShadowEffect.cs
- ByteKeyFrameCollection.cs
- WebPartManager.cs
- IndexerReference.cs
- DefaultSection.cs
- SynchronizationLockException.cs
- DbConnectionFactory.cs
- DbProviderSpecificTypePropertyAttribute.cs
- DataRowComparer.cs
- RegistrationServices.cs
- WebAdminConfigurationHelper.cs
- NativeCompoundFileAPIs.cs
- String.cs
- DecoratedNameAttribute.cs
- FileUtil.cs
- FontFamilyConverter.cs
- Region.cs
- HostSecurityManager.cs
- SqlDuplicator.cs
- WebPartConnectionsCancelVerb.cs
- FlowDocumentPage.cs
- Process.cs
- TreeNodeBindingCollection.cs
- BaseTreeIterator.cs
- PrintDocument.cs
- Serializer.cs
- ByteStack.cs
- DataTableExtensions.cs
- WebPartConnectionsCancelVerb.cs
- UseAttributeSetsAction.cs
- SqlRewriteScalarSubqueries.cs
- SimpleRecyclingCache.cs
- LingerOption.cs
- LazyInitializer.cs
- SchemaTableColumn.cs
- FormatterConverter.cs
- ConditionalDesigner.cs
- MouseEvent.cs
- OrderedDictionary.cs
- SerialStream.cs
- FreezableDefaultValueFactory.cs
- SqlAliasesReferenced.cs
- SoapSchemaExporter.cs
- COSERVERINFO.cs
- CLRBindingWorker.cs
- ISO2022Encoding.cs
- DataViewManager.cs
- NetCodeGroup.cs
- validation.cs
- ListViewSelectEventArgs.cs
- SqlConnectionPoolProviderInfo.cs
- Cursor.cs
- _SafeNetHandles.cs
- Guid.cs
- NullRuntimeConfig.cs
- UnmanagedMarshal.cs
- InProcStateClientManager.cs
- PropertyKey.cs
- EventLevel.cs
- RadioButtonFlatAdapter.cs