void peTrack_DifficultyItemDropped(PEMidiTrack sender, GuitarDifficulty difficulty, DragEventArgs e)
        {
            var o = e.GetDropObject <PETrackDifficulty>();

            o.IfObjectNotNull(op =>
            {
                DoRequestBackup();

                var messages = sender.Track.GetChanMessagesByDifficulty(difficulty);
                sender.Track.Remove(messages);

                var otrack = o.MidiTrack.Track;

                var clonedTrack = otrack.CloneDifficulty(o.Difficulty, difficulty, sender.Track.FileType);

                var clonedMessages = clonedTrack.GetChanMessagesByDifficulty(difficulty).ToList();

                foreach (var msg in clonedMessages)
                {
                    sender.Track.Insert(msg.AbsoluteTicks, msg.Clone());
                }

                SetSelectedItem(sender.Track, o.Difficulty);

                TrackClicked.IfObjectNotNull(x => x(this, sender.Track.Sequence, sender.Track, difficulty));
            });
        }
        void t_TrackDifficultyChanged(object sender, Track track, GuitarDifficulty difficulty)
        {
            (sender as PEMidiTrack).IfObjectNotNull(x =>
            {
                SelectedTrack = x;
            });

            this.SelectedDifficulty = difficulty;

            TrackClicked.IfObjectNotNull(x => x(this, track.Sequence, track, difficulty));
        }
        void setDifficulty(GuitarDifficulty diff)
        {
            if (!diff.IsEasyMediumHardExpert())
            {
                diff = GuitarDifficulty.Expert;
            }

            if (SelectedDifficulty != diff)
            {
                SelectedDifficulty = diff;

                this.track.IfObjectNotNull(tr =>
                                           TrackDifficultyChanged.IfObjectNotNull(x => x(this, tr, this.SelectedDifficulty)));
            }
            else
            {
                TrackClicked.IfObjectNotNull(x => x(this, this.track, this.SelectedDifficulty));
            }
        }
 void t_TrackClicked(object sender, Track track, GuitarDifficulty difficulty)
 {
     TrackClicked.IfObjectNotNull(x => x(this, track.Sequence, track, difficulty));
 }
 private void labelTrackName_Click(object sender, EventArgs e)
 {
     TrackClicked.IfObjectNotNull(x => x(this, this.track, this.SelectedDifficulty));
 }
 private void panelMidiTrack_Click(object sender, EventArgs e)
 {
     TrackClicked.IfObjectNotNull(x => x(this, this.track, this.SelectedDifficulty));
 }