[Mono-bugs] [Bug 412582] New: TableLayoutPanel: Column-/RowStyle/ TableLayoutStyle should be owned by list

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Jul 28 06:21:55 EDT 2008


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: contact at i-nz.net
        ReportedBy: andyhume32 at yahoo.co.uk
         QAContact: mono-bugs at lists.ximian.com
          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.


More information about the mono-bugs mailing list