Esempio n. 1
0
 private void InvertSelectionMenuItemClick(object sender, EventArgs e)
 {
     for (int i = 0; i < TracksListBox.Items.Count; i++)
     {
         TracksListBox.SetSelected(i, !TracksListBox.GetSelected(i));
     }
 }
Esempio n. 2
0
 private void SelectAllMenuItemClick(object sender, EventArgs e)
 {
     if (TracksListBox.SelectionMode != SelectionMode.One)
     {
         for (int i = 0; i < TracksListBox.Items.Count; i++)
         {
             TracksListBox.SetSelected(i, true);
         }
     }
 }
Esempio n. 3
0
        private void TracksListBox_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }
            var index = TracksListBox.IndexFromPoint(e.Location);

            if (index != ListBox.NoMatches)
            {
                _selectedMenuItem = TracksListBox.Items[index] as Track;
                _contextMenuStrip.Show(Cursor.Position);
                _contextMenuStrip.Visible = true;
            }
            else
            {
                _contextMenuStrip.Visible = false;
            }
        }
Esempio n. 4
0
        public string GoToPrevious()
        {
            int selected = -1;

            if (TracksListBox.Items.Count > 0 && TracksListBox.SelectedIndex > 0)
            {
                selected = TracksListBox.SelectedIndex - 1;
                TracksListBox.ClearSelected();
                TracksListBox.SelectedIndex = selected;
            }

            if (GetCurrent().Count > 0)
            {
                return(GetCurrent()[0]);
            }
            else
            {
                return(string.Empty);
            }
        }
Esempio n. 5
0
        public string GoToNext()
        {
            int selected = -1;

            if (TracksListBox.SelectedIndex != -1 && TracksListBox.SelectedIndex < TracksListBox.Items.Count - 1)
            {
                selected = TracksListBox.SelectedIndex + 1;
                TracksListBox.ClearSelected();
                TracksListBox.SelectedIndex = selected;
            }

            if (GetCurrent().Count > 0)
            {
                return(GetCurrent()[0]);
            }
            else
            {
                return(string.Empty);
            }
        }
 private void GoToActive_Click(object sender, RoutedEventArgs e)
 {
     TracksListBox.ScrollIntoView(TracksListBox.SelectedItem);
 }
Esempio n. 7
0
 private void SelectNoneMenuItemClick(object sender, EventArgs e)
 {
     TracksListBox.ClearSelected();
 }