ObjectListView is a .NET ListView wired on caffeine, guarana and steroids. More calmly, it is a C# wrapper around a .NET ListView, which makes the ListView much easier to use and teaches it lots of neat new tricks.
When I used MoveObjects() with an index of 0 with a collection of objects that includes the first object (at index 0), I get an IndexOutOfRangeException because it will try to insert objects at index -1.
Since, the first object (at index 0) will satisfy the if condition, the index will be decreased from 0 to -1.
Should this condition be changed to if (i >= 0 && i < index) instead?
When I used
MoveObjects()
with an index of 0 with a collection of objects that includes the first object (at index 0), I get anIndexOutOfRangeException
because it will try to insert objects at index -1.I narrowed it down to this block of code in
MoveObjects()
: https://github.com/geomatics-io/ObjectListView/blob/8a10cbd934adca7991b2447298a9f22c67368a70/ObjectListView/FastObjectListView.cs#L123-L128Since, the first object (at index 0) will satisfy the
if
condition, the index will be decreased from 0 to -1. Should this condition be changed toif (i >= 0 && i < index)
instead?