コード例 #1
0
ファイル: Topics.cs プロジェクト: akc8012/AutoJon
    public void Load(string path, string listName)
    {
        var trelloData = new TrelloData();

        trelloData.Load(path);

        TopicList = trelloData.GetTopics(listName).ToList();

        var shuffleBox = new ShuffleBox();

        TopicList = shuffleBox.Shuffle(TopicList);
        SetTopic(Index);
    }
コード例 #2
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()));
        }