[Mono-bugs] [Bug 522783] New: ComponentResourceManager.ApplyResources() for type TableLayoutPanel only works once per Application
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Thu Jul 16 13:50:14 EDT 2009
http://bugzilla.novell.com/show_bug.cgi?id=522783
Summary: ComponentResourceManager.ApplyResources() for type
TableLayoutPanel only works once per Application
Classification: Mono
Product: Mono: Class Libraries
Version: SVN
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: CORLIB
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: tom_hindle at sil.org
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Created an attachment (id=305651)
--> (http://bugzilla.novell.com/attachment.cgi?id=305651)
Test case file 1
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11)
Gecko/2009060308 Ubuntu/9.04 (jaunty) Firefox/3.0.11
Ataching Test case showing problem.
Caused because of the following:
1. TableLayoutPanel.LayoutSettings property can only be set once as the
TableLayoutSettings object isSerialized method is set to false.
(TableLayoutPanel.cs)
2. When first Applying Resources (ComponentResourceManager.cs)
ResourceManager.InternalGetResourceSet ( ResourceManager.cs) creates a
ResourceSet for a given CultureInfo. Subsequent InternalGetResourceSet use a
cached value. (so TableLayoutSettings object is not recreated)
This can be fixed by either not caching (or at least clearing the cache when a
new ComponentResourceManager is created (HACK)) or by being disciplined and not
modifying properties that are set be ApplyResources in their setters.
I guess another alternative would be to deep copy the objects before they are
passed via reflection to ComponentResourceManager.cs ApplyResources ~= line 92
but this again has efficiently issues.
I'm not sure the best way to fix this is in TableLayoutPanel (which will just
fix this particular manifestation of the problem) or fix it at the
ApplyResources level which will involve being less efficient?
Reproducible: Always
Steps to Reproduce:
1. Compile and run Attached test files (both cs and resx, use resx as embedded
resources)
2.
3.
Actual Results:
throws NotSupportedException ("LayoutSettings value cannot be set directly.")
Expected Results:
No Exception should be thrown (like .NET)
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list