[Mono-bugs] [Bug 497562] New: TableLayoutPanel internal functions set_LayoutSettings throws unwanted Exception

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Apr 23 04:14:57 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=497562


           Summary: TableLayoutPanel internal functions set_LayoutSettings
                    throws unwanted Exception
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Keywords: L10N, UI
          Severity: Normal
          Priority: P5 - None
         Component: Windows.Forms
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: yohan.lasorsa at inria.fr
         QAContact: mono-bugs at lists.ximian.com
          Found By: DeveloperNet


Created an attachment (id=287681)
 --> (http://bugzilla.novell.com/attachment.cgi?id=287681)
A minimal test project that reproduce the bug

Description of Problem:

When using a localized form, any TableLayoutPanel inside can't be initialized
from a resource set a second time in the lifetime of the application or it will
throw this exception:

----------------------------------------
System.Reflection.TargetInvocationException: Exception has been thrown by the
target of an invocation. ---> System.NotSupportedException: LayoutSettings
value cannot be set directly.
  at System.Windows.Forms.TableLayoutPanel.set_LayoutSettings
(System.Windows.Forms.TableLayoutSettings value) [0x00000] 
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke
(object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] 
  --- End of inner exception stack trace ---
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture) [0x00000] 
  at System.Reflection.MonoProperty.SetValue (System.Object obj, System.Object
value, BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] index, System.Globalization.CultureInfo culture) [0x00000] 
  at System.Reflection.PropertyInfo.SetValue (System.Object obj, System.Object
value, System.Object[] index) [0x00000] 
  at System.ComponentModel.ComponentResourceManager.ApplyResources
(System.Object value, System.String objectName,
System.Globalization.CultureInfo culture) [0x00000] 
  at System.ComponentModel.ComponentResourceManager.ApplyResources
(System.Object value, System.String objectName) [0x00000] 
  at TableLayoutBug.Form1..ctor () [0x00000] 
----------------------------------------------------------------

No problem at all when using MS.NET


Steps to reproduce the problem:

1. Use a code like this:
System.ComponentModel.ComponentResourceManager resources = new
System.ComponentModel.ComponentResourceManager(typeof(Form1));
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");

2. The second time the method resources.ApplyResources(this.tableLayoutPanel1,
"tableLayoutPanel1"); is called anywhere, anytime in the application (calling
it explicitly or simply creating a new Form1 object that contains it) will
cause an exception to be thrown.


Actual Results:
Exception is thrown.

Expected Results:
No exception thrown.

How often does this happen? 
Everytime.

Additional Information:
See attached minimal test project

-- 
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