https://bugzilla.novell.com/show_bug.cgi?id=412582


           Summary: TableLayoutPanel: Column-/RowStyle/TableLayoutStyle
                    should be owned by list
           Product: Mono: Class Libraries
           Version: 1.9
          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: ---


Column-/RowStyle/TableLayoutStyle should be owned by list

Found while creating the repro app.  Once a style is added to its collection,
adding it to another style collection should be prevented.  This behaviour is
necessary for the next bug I will report.


[[
    [Test]
    public void TableLayoutStyleItemIsOwned()
    {
        try {
            ColumnStyle style = new ColumnStyle ();
            TableLayoutColumnStyleCollection coll = new
TableLayoutPanel().ColumnStyles;
            coll.Add(style);
            TableLayoutColumnStyleCollection coll2 = new
TableLayoutPanel().ColumnStyles;
            coll2.Add(style);
            Assert.Fail("should have thrown -- Column");
        } catch (ArgumentException ex) {
            const string Msg = "Cannot add or insert the item 'ColumnStyle' in
more than one place. You must first remove it from its current location or
clone it.";
            const string ParameterName = "style";
            Assert.AreEqual(ParameterName, ex.ParamName, "ParamName");
        }
        try {
            RowStyle style = new RowStyle ();
            TableLayoutRowStyleCollection coll = new
TableLayoutPanel().RowStyles;
            coll.Add(style);
            TableLayoutRowStyleCollection coll2 = new
TableLayoutPanel().RowStyles;
            coll2.Add(style);
            Assert.Fail("should have thrown -- Row");
        } catch (ArgumentException ex) {
            const string Msg = "Cannot add or insert the item 'RowStyle' in
more than one place. You must first remove it from its current location or
clone it.";
            const string ParameterName = "style";
            Assert.AreEqual(ParameterName, ex.ParamName, "ParamName");
        }
    }
]]


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

Reply via email to