private static void OnSongDisplayed(SongDisplayedEventArgs args) { if (SongDisplayed != null && _this != null) { SongDisplayed(_this, args); } }
private void SetCurrentSongInfo() { currentSongInfo = new SongDisplayedEventArgs(_song, (ISong) navigate.Items[ (pos + navigate.Items.Count + 1)% navigate.Items.Count], (ISong) navigate.Items[ (pos + navigate.Items.Count - 1)% navigate.Items.Count]); }
private void ViewSongDisplayed(object sender, SongDisplayedEventArgs args) { this.Update(args); }
private void SetCurrentSongInfo() { currentSongInfo = new SongDisplayedEventArgs(this.song, (ISong) this.navigate.Items[ (this.pos + this.navigate.Items.Count + 1) % this.navigate.Items.Count], (ISong) this.navigate.Items[ (this.pos + this.navigate.Items.Count - 1) % this.navigate.Items.Count]); }
private void Update(SongDisplayedEventArgs songInfo) { if (songInfo == null) { this.titleLabel.Text = ""; this.nrLabel.Text = "n/a"; this.nextBtn.Enabled = false; this.lastBtn.Enabled = false; this.nextLabel.Text = ""; this.prevLabel.Text = ""; this.jumpMarksListBox.Items.Clear(); return; } this.titleLabel.Text = songInfo.DisplayedSong != null ? songInfo.DisplayedSong.Title : ""; this.nrLabel.Text = songInfo.DisplayedSong != null ? songInfo.DisplayedSong.Number.ToString().PadLeft(4, '0') : "n/a"; this.nextBtn.Enabled = songInfo.NextSong != null; this.lastBtn.Enabled = songInfo.PreviousSong != null; this.nextLabel.Text = songInfo.NextSong != null ? songInfo.NextSong.Number.ToString().PadLeft(4, '0') : ""; this.prevLabel.Text = songInfo.PreviousSong != null ? songInfo.PreviousSong.Number.ToString().PadLeft(4, '0') : ""; this.jumpMarksListBox.BeginUpdate(); this.jumpMarksListBox.Items.Clear(); foreach (JumpMark jumpMark in songInfo.Jumpmarks) { this.jumpMarksListBox.Items.Add(jumpMark); } this.jumpMarksListBox.EndUpdate(); }