Пример #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            txtLyrics.Clear();
            string       artist    = txtArtistName.Text;
            string       songTitle = txtSongTitle.Text;
            LyricService ls        = new LyricService();
            LyricData    result    = ls.GetLyrics(artist, songTitle);

            if (result != null)
            {
                txtLyrics.Text = result.Lyrics;
            }
            else
            {
                txtLyrics.Text = "song not found";
            }
        }
Пример #2
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            txtLyrics.Clear();
            string       artist    = txtArtistName.Text;
            string       songTitle = txtSongTitle.Text;
            LyricService LS        = new LyricService();
            SongLyrics   result    = LS.GetLyrics(artist, songTitle);

            if (result != null)
            {
                txtLyrics.Text = result.Lyrics;
            }
            else
            {
                MessageBox.Show("No lyrics found");
            }
        }
Пример #3
0
        async void UpDateSong()
        {
            _albumRoot               = PlayingService.PlayingAlbum;
            _songsItem               = PlayingService.PlayingSong;
            Image_album.Source       = PlayingService.PlayingAlbumBitmapImage;
            Button_albumName.Content = _albumRoot.album.name;
            string name = "";

            for (int i = 0; i < _songsItem.ar.Count; i++)
            {
                if (i != 0)
                {
                    name += "/";
                }
                name += _songsItem.ar[i].name;
            }
            ListBox_artists.ItemsSource = _songsItem.ar;
            Button_artistName.Content   = name;
            TextBlock_songName.Text     = _songsItem.Name;
            LyricRoot lyricRoot = await Task.Run(() => LyricService.GetLyric(_songsItem.Id));

            if (lyricRoot == null)
            {
                ListBox_lyric.ItemsSource = null;
                return;
            }
            lyricStrs = LyricService.GetLyricStrs(lyricRoot);
            if (lyricStrs != null)
            {
                if (lyricStrs.Count == 0)
                {
                    DateTime dateTime = DateTime.Now;
                    lyricStrs.Add(new LyricStr()
                    {
                        DateTime = dateTime, Original = "无歌词"
                    });
                }
                ListBox_lyric.ItemsSource = lyricStrs;
                ListBox_lyric.ScrollIntoView(lyricStrs.First());
            }
            UpDateComment();
            UpDateSimiSongs();
        }
Пример #4
0
        //private SettingsForm _settingsForm;
        public MainForm()
        {
            lyricService = new LyricService();
            playerService = new PlayerService();

            InitializeComponent();

            var gameFile = "C:\\Users\\Joe\\Dropbox\\GVSU\\XLS Files\\GameData.xlsx";
            if(!File.Exists(gameFile))
            {
                LoadTeamFile.Title = "Choose File For Game Data";
                DialogResult gameData = LoadTeamFile.ShowDialog();
                if (gameData == DialogResult.OK)
                {
                    gameFile = LoadTeamFile.FileName;
                }
            }

            Game = new Game(gameFile);

            LoadTeamFile.Title = "Choose File For Home Team";
            DialogResult homeFile = LoadTeamFile.ShowDialog();
            if (homeFile == DialogResult.OK)
            {
                var file = LoadTeamFile.FileName;
                try
                {
                    Home = new Team(file);
                }
                catch (Exception er)
                {

                }
            }

            LoadTeamFile.Title = "Choose File For Away Team";
            DialogResult awayFile = LoadTeamFile.ShowDialog();
            if (awayFile == DialogResult.OK)
            {
                var file = LoadTeamFile.FileName;
                try
                {
                    Away = new Team(file);
                }
                catch (Exception er)
                {

                }
            }

            CG = new CG(Home, Away, Game);

            QuarterLabel.Text = Game.QuarterLong;
            Game.ClockVisible = true;
            updateClockForm();
            TimerIntervalLabel.Text = GameTimer.Interval.ToString();

            AwayTeamLabel.Text = Away.BugName;
            HomeTeamLabel.Text = Home.BugName;
            AwayTeamScoreLabel.Text = Away.Score.ToString();
            HomeTeamScoreLabel.Text = Home.Score.ToString();

            DownLabel.Text = Game.Down;
            YardsToGoTextBox.Text = "10";

            // instantiate data service with necessary site
            DataAddress.Text = "http://static.sidearmstats.com/static/json_gvsu_football_stats.js";
            var dataAddress = DataAddress.Text;
            dataService = new DataService(dataAddress);

            // pre populate labels and buttons
            HomeCoachLabel.Text = Home.CoachName;
            AwayCoachLabel.Text = Away.CoachName;
            ShowAnnouncer1.Text = Game.Announcer1;
            ShowAnnouncer2.Text = Game.Announcer2;
            ShowAnnouncerDouble.Text = Game.Announcer1 + " / " + Game.Announcer2;

            // clear out player labels
            homePlayerLabel1.Text = "";
            HomePlayer1PassingLabel.Text = "";
            HomePlayer1ReceivingLabel.Text = "";
            HomePlayer1RushingLabel.Text = "";

            awayPlayerLabel1.Text = "";
            AwayPlayer1PassingLabel.Text = "";
            AwayPlayer1ReceivingLabel.Text = "";
            AwayPlayer1RushingLabel.Text = "";
        }