Exemple #1
0
        private void Selector(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Middle)
            {
                if (ModifierKeys.HasFlag(Keys.Control))
                {
                    PlayEndOfSelectedAndStartOfNextSong();
                    return;
                }
                else
                {
                    PlayThisSong();
                    return;
                }
            }

            if (QuickSweeper.SweeperModeOn && !(ModifierKeys.HasFlag(Keys.Control) || ModifierKeys.HasFlag(Keys.Alt) ||
                                                ModifierKeys.HasFlag(Keys.Shift)))
            {
                if (QuickSweeper.Current?.box.Items.Count > 0)
                {
                    if (QuickSweeper.Current.box.SelectedItems.Count > 0)
                    {
                        currentListImplemented.Insert(this.Song.Index, new FirePlaySong(QuickSweeper.Current.DictListOfFiles[QuickSweeper.Current.box.SelectedItem.ToString()]));
                        return;
                    }
                }
            }

            if (ModifierKeys.HasFlag(Keys.Control) && ModifierKeys.HasFlag(Keys.Shift))
            {
                //PlayEndOfSelectedAndStartOfNextSong();
                return;
            }

            if (ModifierKeys.HasFlag(Keys.Control))
            {
                if (!ClipBoard.IsEmpty)
                {
                    currentListImplemented.Insert(Index, ClipBoard.Retrive());
                }
                else
                {
                    this.checkbox_selected.Checked = !this.checkbox_selected.Checked;
                }
            }
            else if (ModifierKeys.HasFlag(Keys.Shift) || ModifierKeys.HasFlag(Keys.ShiftKey))
            {
                if (lastSelected != null && this != lastSelected)
                {
                    if (this.Song.Index < lastSelected.Song.Index)
                    {
                        currentListImplemented.Songs.ForEach((x) =>
                        {
                            x.SongView.checkbox_selected.Checked = false;
                            if (x.Index >= this.Song.Index && x.Index <= lastSelected.Song.Index)
                            {
                                x.SongView.checkbox_selected.Checked = true;
                            }
                        });
                    }
                    if (this.Song.Index > lastSelected.Song.Index)
                    {
                        currentListImplemented.Songs.ForEach((x) =>
                        {
                            x.SongView.checkbox_selected.Checked = false;
                            if (x.Index <= this.Song.Index && x.Index >= lastSelected.Song.Index)
                            {
                                x.SongView.checkbox_selected.Checked = true;
                            }
                        });
                    }
                }
            }
            else
            {
                if (!ClipBoard.IsEmpty)
                {
                    currentListImplemented.Insert(Index, ClipBoard.RetriveOne());
                }
                else
                {
                    currentListImplemented.Songs.ForEach((x) => x.SongView.Unselect());
                    this.Select();
                }
            }

            if (!(ModifierKeys.HasFlag(Keys.Shift) || ModifierKeys.HasFlag(Keys.ShiftKey)))
            {
                lastSelected = this;
            }
        }