[MWF] Fix PropertyGridTest.PropertyGrid_ArrayParentTest by returning the correct...
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 12 Dec 2014 00:50:43 +0000 (01:50 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Fri, 12 Dec 2014 01:39:02 +0000 (02:39 +0100)
The code in ComponentModel (https://github.com/mono/referencesource/blob/7dc4e513eafd3fb30d34111948ef14c981264463/System/compmod/system/componentmodel/CategoryAttribute.cs#L276) looks up the category name by string concatenation, which means it wasn't captured in our SR.cs.
We also can't add the correct value for PropertyCategoryDefault as a string constant to SR.cs since the value is retrieved via GetObject () and we currently just return the parameter name there.

A short-term workaround is to just special case PropertyCategoryDefault in GetObject ().

mcs/class/System/ReferenceSources/SR.cs

index e0ca94d10c0967f3dda71c7f7a233a9210479bc1..258c4f734c96e673acff0e00f74c9d93b6ea59c2 100644 (file)
@@ -7,6 +7,12 @@ partial class SR
 {
        public static object GetObject (string name)
        {
+               // The PropertyGrid code in WinForms and the corresponding tests
+               // rely on PropertyCategoryDefault returning the correct value.
+               // Handle this special case until we have proper resource lookup. 
+               if (name == "PropertyCategoryDefault")
+                       return "Misc";
+
                return name;
        }