Esempio n. 1
0
        //------------------------------------------------------------------------------------
        private void SearchButton_Click(object sender, EventArgs e)
        {
            shortMList.Clear();

            var mr = new MovieResponse();

            try
            {
                DBConnect.GetResponse("s", Title.Text.Trim(), ref mr);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                MoreButton.Enabled = false;
            }

            SearchMovie ms = mr as SearchMovie;

            foreach (var item in ms.Search)
            {
                shortMList.Add(item);
            }

            MovieListBox.DataSource = null;
            MovieListBox.DataSource = shortMList;
            MoreButton.Enabled      = true;
            MovieListBox.Focus();
            MovieListBox.SelectedIndex = 0;
            if (Uri.IsWellFormedUriString(shortMList[0].Poster, UriKind.Absolute))
            {
                Poster.Load(shortMList[0].Poster);
            }
        }
Esempio n. 2
0
 //------------------------------------------------------------------------------------
 private void Title_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         SearchButton.PerformClick();
         MovieListBox.Focus();
     }
 }