public override bool MoveItems (IKImageBrowserView aBrowser, NSIndexSet indexes, nint destinationIndex) { //indexes are not sequential, and may be on both sides of destinationIndex. //indexes will change, but I will put the items in after the item at destination //FIXME - missing methods on NSIndexSet //FIXME make an extension method on List<> int destination = (int) destinationIndex - (int)indexes.Where (x =>(int) x <(int) destinationIndex).Count (); List<BrowseItem> movingImages = new List<BrowseItem> (); foreach (int index in indexes) movingImages.Add (images[index]); foreach (BrowseItem item in movingImages) images.Remove (item); images.InsertRange (destination, movingImages); aBrowser.ReloadData(); return true; }
public override bool MoveItems(IKImageBrowserView aBrowser, NSIndexSet indexes, nint destinationIndex) { //indexes are not sequential, and may be on both sides of destinationIndex. //indexes will change, but I will put the items in after the item at destination //FIXME - missing methods on NSIndexSet //FIXME make an extension method on List<> int destination = (int)destinationIndex - (int)indexes.Where(x => (int)x < (int)destinationIndex).Count(); List <BrowseItem> movingImages = new List <BrowseItem> (); foreach (int index in indexes) { movingImages.Add(images[index]); } foreach (BrowseItem item in movingImages) { images.Remove(item); } images.InsertRange(destination, movingImages); aBrowser.ReloadData(); return(true); }