https://bugzilla.novell.com/show_bug.cgi?id=391924
Summary: PropertyGrid: Use ShouldSerializeXXXX method to know
whether property has non-default value
Product: Mono: Class Libraries
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Windows.Forms
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [email protected]
Found By: ---
PropertyGrid displays a property value in bold if that value has been set to a
value different than its default / should be written out if serialized. It
currently uses the DefaultValueAttribute, however it appears not to use the
ShouldSerializeXXXXX method.
* Repro using mwf-designer
Drag any control onto the form and note that its BackColor property is bold but
if you save the Form there's no value saved out to InitializeComponent. So, it
shouldn't be bold. (If one changes the value it is then serialized out, and
still displayed in bold). The ShouldSerializeBackColor method controls this
behaviour.
* Or, repro in PropGridObjMany7.cs attached, all in grid category
"ShouldSerializeXXXX/ResetXXX".
1) Property StringSsRNoNeinNyet has both ShouldSerialize and Reset methods,
together they apply the default of "No", and accept "Nein" and "Nyet" as
equivalent defaults.
Expected: If "No", "Nein" or "Nyet" then the value should /not/ be bold.
<Reset> calls the reset method which sets "No".
2) StringSsEvenLengthNoSz has a ShouldSerialize method, which controls that
strings with even length aren't serialized.
Expected: If even length string, then the value should /not/ be bold.
3) StringRaDefault has a Reset method, which applies "aDefault".
Expected: As there's no DefaultValueAttribute or ShouldSerialize method, the
value should always be bold. <Reset> calls the reset method which sets
"aDefault".
I think the fault is not in System.ComponentModel as the fault is still
apparent when running the app on the MSFT runtime but using Mono's SWF.
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs