2009-09-03 Ivan N. Zlatev <contact@i-nz.net>
authorIvan Zlatev <ivan@ivanz.com>
Thu, 3 Sep 2009 18:00:48 +0000 (18:00 -0000)
committerIvan Zlatev <ivan@ivanz.com>
Thu, 3 Sep 2009 18:00:48 +0000 (18:00 -0000)
* DataColumnPropertyDescriptor.cs, DataView.cs: Not browsable if Hidden.
[Fixes the second part of bug #536547]

svn path=/trunk/mcs/; revision=141272

mcs/class/System.Data/System.Data/ChangeLog
mcs/class/System.Data/System.Data/DataColumnPropertyDescriptor.cs
mcs/class/System.Data/System.Data/DataView.cs

index d72624c63cd4ee97401b9ee5b8fe9689f5676e16..5100000ef4634f5b7749538c38d207a90399489e 100644 (file)
@@ -1,3 +1,8 @@
+2009-09-03  Ivan N. Zlatev  <contact@i-nz.net>
+
+       * DataColumnPropertyDescriptor.cs, DataView.cs: Not browsable if Hidden.
+       [Fixes the second part of bug #536547]
+
 2009-08-25  Veerapuram Varadhan  <vvaradhan@novell.com>
 
        ** Fixes #521951
index dc8ae4f9e61dd64ed480df38204958802ec4807f..50e2491376558bda505e11bd0d32eb4efed177f7 100644 (file)
@@ -42,6 +42,8 @@ namespace System.Data
                private bool readOnly = true;
                private Type componentType = null;
                private Type propertyType = null;
+               private bool browsable = true;
+
                //private PropertyInfo prop = null;
                private int columnIndex = 0;
 
@@ -75,6 +77,11 @@ namespace System.Data
                        propertyType = type;
                }
 
+               public void SetBrowsable (bool browsable)
+               {
+                       this.browsable = browsable;
+               }
+
                public override object GetValue (object component) 
                {
                        // FIXME: what is the correct way to Get a Value?
@@ -149,6 +156,10 @@ namespace System.Data
                        }
                }
 
+               public override bool IsBrowsable {
+                       get { return browsable && base.IsBrowsable; }
+               }
+
                public override Type PropertyType {
                        get {
                                return propertyType;
index 0afeb165e8956d0119fa9a0088b98ebccf768b69..be283d837cfb982c5073708dd2ec3b7d3c1f448a 100644 (file)
@@ -796,6 +796,7 @@ namespace System.Data
                                descriptor.SetComponentType (typeof (System.Data.DataRowView));\r
                                descriptor.SetPropertyType (dataColumn.DataType);\r
                                descriptor.SetReadOnly (dataColumn.ReadOnly);\r
+                               descriptor.SetBrowsable (dataColumn.ColumnMapping != MappingType.Hidden);\r
                                descriptors [d++] = descriptor;\r
                        }\r
                        for (int rel = 0; rel < dataTable.ChildRelations.Count; rel ++) {\r