1 //------------------------------------------------------------------------------
2 // <copyright file="DataRelationPropertyDescriptor.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 // <owner current="true" primary="true">Microsoft</owner>
6 // <owner current="true" primary="false">Microsoft</owner>
7 // <owner current="false" primary="false">Microsoft</owner>
8 //------------------------------------------------------------------------------
10 namespace System.Data {
11 using System.ComponentModel;
14 /// <para>[To be supplied.]</para>
16 internal sealed class DataRelationPropertyDescriptor : PropertyDescriptor {
18 DataRelation relation;
20 internal DataRelation Relation {
26 internal DataRelationPropertyDescriptor(DataRelation dataRelation) : base(dataRelation.RelationName, null) {
27 this.relation = dataRelation;
30 public override Type ComponentType {
32 return typeof(DataRowView);
36 public override bool IsReadOnly {
42 public override Type PropertyType {
44 return typeof(IBindingList);
48 public override bool Equals(object other) {
49 if (other is DataRelationPropertyDescriptor) {
50 DataRelationPropertyDescriptor descriptor = (DataRelationPropertyDescriptor) other;
51 return(descriptor.Relation == Relation);
56 public override Int32 GetHashCode() {
57 return Relation.GetHashCode();
60 public override bool CanResetValue(object component) {
64 public override object GetValue(object component) {
65 DataRowView dataRowView = (DataRowView) component;
66 return dataRowView.CreateChildView(relation);
69 public override void ResetValue(object component) {
72 public override void SetValue(object component, object value) {
75 public override bool ShouldSerializeValue(object component) {