private void MvDwn_Click(object sender, EventArgs e) { if (SFList.SelectedItems.Count > 0) { object selected = SFList.SelectedItem; int indx = SFList.Items.IndexOf(selected); int totl = SFList.Items.Count; if (indx == totl - 1) { SFList.Items.Remove(selected); SFList.Items.Insert(0, selected); SFList.SetSelected(0, true); } else { SFList.Items.Remove(selected); SFList.Items.Insert(indx + 1, selected); SFList.SetSelected(indx + 1, true); } } KeppyMIDIConverter.MainWindow.KMCGlobals.Soundfonts = new string[SFList.Items.Count]; SFList.Items.CopyTo(KeppyMIDIConverter.MainWindow.KMCGlobals.Soundfonts, 0); }
private void MoveSoundFonts(MoveDirection D) { List <Int32> SelectedItemsBefore = new List <Int32>(); foreach (SoundFont SF in SFList.SelectedItems) { Int32 OldIndex = Program.SFArray.List.IndexOf(SF); Int32 NewIndex = Program.SFArray.List.Move(OldIndex, D); if (NewIndex != -1) { SelectedItemsBefore.Add(NewIndex); } Debug.PrintToConsole("ok", String.Format("Moved SoundFont {0}. Direction = {1}", SF.GetSoundFontPath, D)); } SFList.ClearSelected(); foreach (Int32 SF in SelectedItemsBefore) { SFList.SetSelected(SF, true); } RebindList(); }