/// <summary> /// Moves the selected indicies down. /// </summary> /// <param name="index">Index.</param> /// <param name="range">Range.</param> void MoveSelectedIndiciesDown(int index, int range) { var start = index + 1; var end = start + range; var remove_indicies = SelectedIndicies.Where(x => start <= x && x <= end).ToList(); var add_indicies = remove_indicies.Convert(x => x + range); SilentDeselect(remove_indicies); SilentSelect(add_indicies); }
/// <summary> /// Moves the selected indicies up. /// </summary> /// <param name="index">Index.</param> /// <param name="range">Range.</param> void MoveSelectedIndiciesUp(int index, int range) { var start = index + 1; var end = start + range; //deselect indicies in removed range SelectedIndicies.Where(x => start <= x && x <= end).ForEach(Deselect); var remove_indicies = SelectedIndicies.Where(x => x > end).ToList(); var add_indicies = remove_indicies.Select(x => x - range).ToList(); SilentDeselect(remove_indicies); SilentSelect(add_indicies); }