Ejemplo n.º 1
0
        async private void OnRenderComplete(object sender, EventArgs e)
        {
            await renderTask;

            if (charts.Count == 0)
            {
                GroupPlayback.Invoke(new Action(() => GroupPlayback.Enabled = false));
                return;
            }

            int repeat     = (int)RepeatBox.Invoke(new Func <int>(() => RepeatBox.SelectedIndex));
            int difficulty = (int)DifficultyBox.Invoke(new Func <int>(() => DifficultyBox.SelectedIndex));

            if (repeat != 1)
            {
                SetHighlightState(false);

                if ((bool)ShuffleBox.Invoke(new Func <bool>(() => ShuffleBox.Checked)))
                {
                    var randomizer = new Random();
                    playback.Track = randomizer.Next(charts.Count);
                }
                else if (repeat == 2 && playback.Track >= charts.Count)
                {
                    playback.Track = 0;
                }
                else if (playback.Track < charts.Count - 1)
                {
                    playback.Track++;
                }
                else
                {
                    playback.Track = 0;
                    return;
                }
            }

            MusicList.Invoke(new Action(() => MusicList.FocusedItem = MusicList.Items[playback.Track]));
            BtnPlay.Invoke(new Action(() => BtnPlay.PerformClick()));
        }
        void ReleaseDesignerOutlets()
        {
            if (AddTagButton != null)
            {
                AddTagButton.Dispose();
                AddTagButton = null;
            }

            if (ArrangerBox != null)
            {
                ArrangerBox.Dispose();
                ArrangerBox = null;
            }

            if (BackgroundBox != null)
            {
                BackgroundBox.Dispose();
                BackgroundBox = null;
            }

            if (BookmarkLabelBox != null)
            {
                BookmarkLabelBox.Dispose();
                BookmarkLabelBox = null;
            }

            if (BookmarkList != null)
            {
                BookmarkList.Dispose();
                BookmarkList = null;
            }

            if (BookmarkMeasureBox != null)
            {
                BookmarkMeasureBox.Dispose();
                BookmarkMeasureBox = null;
            }

            if (ComposerBox != null)
            {
                ComposerBox.Dispose();
                ComposerBox = null;
            }

            if (CopyrightBox != null)
            {
                CopyrightBox.Dispose();
                CopyrightBox = null;
            }

            if (DifficultyBox != null)
            {
                DifficultyBox.Dispose();
                DifficultyBox = null;
            }

            if (FingerHintBox != null)
            {
                FingerHintBox.Dispose();
                FingerHintBox = null;
            }

            if (HandsBox != null)
            {
                HandsBox.Dispose();
                HandsBox = null;
            }

            if (LicenseBox != null)
            {
                LicenseBox.Dispose();
                LicenseBox = null;
            }

            if (MadeFamousByBox != null)
            {
                MadeFamousByBox.Dispose();
                MadeFamousByBox = null;
            }

            if (PartsBox != null)
            {
                PartsBox.Dispose();
                PartsBox = null;
            }

            if (PropertiesGroup != null)
            {
                PropertiesGroup.Dispose();
                PropertiesGroup = null;
            }

            if (RatingBox != null)
            {
                RatingBox.Dispose();
                RatingBox = null;
            }

            if (RemoveBookmarkButton != null)
            {
                RemoveBookmarkButton.Dispose();
                RemoveBookmarkButton = null;
            }

            if (RemoveTagButton != null)
            {
                RemoveTagButton.Dispose();
                RemoveTagButton = null;
            }

            if (RetargetButton != null)
            {
                RetargetButton.Dispose();
                RetargetButton = null;
            }

            if (SongList != null)
            {
                SongList.Dispose();
                SongList = null;
            }

            if (SubtitleBox != null)
            {
                SubtitleBox.Dispose();
                SubtitleBox = null;
            }

            if (TagBox != null)
            {
                TagBox.Dispose();
                TagBox = null;
            }

            if (TagList != null)
            {
                TagList.Dispose();
                TagList = null;
            }

            if (TitleBox != null)
            {
                TitleBox.Dispose();
                TitleBox = null;
            }

            if (UniqueIdBox != null)
            {
                UniqueIdBox.Dispose();
                UniqueIdBox = null;
            }
        }