[Mono-bugs] [Bug 395345] PropertyGrid: items are unsorted in HEAD

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu May 29 09:28:21 EDT 2008


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

User contact at i-nz.net added comment
https://bugzilla.novell.com/show_bug.cgi?id=395345#c1





--- Comment #1 from Ivan Zlatev <contact at i-nz.net>  2008-05-29 07:28:20 MDT ---
(In reply to comment #0 from Andy Hume)
> Would a simpler change have worked, something like this?
> 
> int unique = 0;
> internal void Add (GridItem grid_item)
> {
>   if (!list.ContainsKey(grid_item.Label))
>     list.Add (grid_item.Label, grid_item);
>   else
>     list.Add(grid_item.Label + "_" + (++unique).ToString(), grid_item);
> }
> 
> Don't know when GridItemCollection.this[String] is used, but it can only return
> one of the duplicated whatever the implementation.
> 

The reason why I didn't do something like that was that there was a Remove
method, so if an item is removed then I would have had to track and rename back
to the original the conflicting ones. Just before committing I dropped the
Remove method as it wasn't used by anything, so what you are proposing makes a
lot more sense.

I will look at this right now.


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