Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ListViewBanksSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            PcgViewModel.BanksChanged();
            Patches();

            // Due to some bug, remove all selected items from the same bank type which are selected, except when ALL items
            // are to be removed (in the case of going to another bank type or all-patches.
            try
            {
                listViewBanks.UpdateLayout();
            }
            catch (InvalidOperationException)
            {
                // Ignore.
            }

            if (e.RemovedItems.Count > 0)
            {
                var selectedBanks = PcgViewModel.Banks.Where(item => item.IsSelected &&
                                                             item.Parent == ((IBank)(e.RemovedItems[0])).Parent).ToList().Count;

                if (selectedBanks != e.RemovedItems.Count)
                {
                    foreach (var bank in PcgViewModel.Banks.Where(item => item.IsSelected && (e.RemovedItems.Contains(item))))
                    {
                        bank.IsSelected = false;
                    }
                }

                PcgViewModel.NumberOfSelectedPatches = PcgViewModel.Patches.Count(item => item.IsSelected);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 private void OnViewPropertyChangedAllPatchesSelected()
 {
     if (PcgViewModel.AllPatchesSelected)
     {
         SetAllPatchesGridViews();
         PcgViewModel.BanksChanged();
         Patches();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 private void OnViewPropertyChangedWaveSequenceBanksSelected()
 {
     if (PcgViewModel.WaveSequenceBanksSelected)
     {
         SetWaveSequenceBanksGridViews();
         PcgViewModel.BanksChanged();
         Patches();
     }
 }
Exemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 private void OnViewPropertyChangedDrumPatternBanksSelected()
 {
     if (PcgViewModel.DrumPatternBanksSelected)
     {
         SetDrumPatternBanksGridViews();
         PcgViewModel.BanksChanged();
         Patches();
     }
 }
Exemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 private void OnViewPropertyChangedSetListsSelected()
 {
     if (PcgViewModel.SetListsSelected)
     {
         SetSetListsGridViews();
         PcgViewModel.BanksChanged();
         Patches();
     }
 }
Exemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 private void OnViewPropertyChangedCombiBanksSelected()
 {
     if (PcgViewModel.CombiBanksSelected)
     {
         SetCombiBanksGridViews();
         PcgViewModel.BanksChanged();
         Patches();
     }
 }
Exemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 private void OnViewPropertyChangedProgramBanksSelected()
 {
     if (PcgViewModel.ProgramBanksSelected)
     {
         SetProgramBanksGridViews();
         PcgViewModel.BanksChanged();
         Patches();
     }
 }