Esempio n. 1
0
        private void Form1_Load(object sender, EventArgs e)
        { 
            Favorites = showlist.ReadShowsFile();
            wishlist.ShowListPath = Utility.WishListPath;
            WishList = wishlist.ReadShowsFile();

            if (Favorites.Shows.Count() > 0)
                UpdateFavorites();  
            
            if (WishList.Shows.Count() > 0)
            {
                foreach (AShow show in WishList.Shows)
                {
                    if (show != null)
                        lstvw_WishList.Items.Add(show.ToString());
                }
            }
            Task.Run(() =>
            { 
                SyncShows();
            });
            pnlWishList.Location = pnlFavorites.Location; // Set wishlist panel to be in same location as favorites since designer wont let me place on exactly top
        } 
Esempio n. 2
0
        private AShow GetShowsFromListView(string listview)
        {
            AShow shows = new AShow(1);
            ListView.ListViewItemCollection collection = null;
            if (listview == "Favorites")
                collection = new ListView.ListViewItemCollection(lstv_Favorites);
            else if (listview == "WishList")
                collection = new ListView.ListViewItemCollection(lstvw_WishList);

            this.Invoke((MethodInvoker)delegate {
                foreach (ListViewItem li in collection)
                {
                    if (li.Text != "Add" & li.Text.IndexOf("file is corrupt") == -1 & li.Text.IndexOf("file doesn't exist") == -1)
                    {
                        AShow t = new AShow(li.Text);
                        shows.Add(t);
                    }
                }
            });
            return shows;
        }
Esempio n. 3
0
 private void lstbx_Favorites_MouseClick(object sender, MouseEventArgs e)
 {
     if (lstv_Favorites.SelectedItems.Count > 0)
     {
         if (myComputer.Network.IsAvailable == true)
         {
             if (bgw_Search.IsBusy == false)
             {
                 //lstbx_SearchResults.Items.Clear();
                 progbar_Search.Visible = true;
                 //MAKE SURE THERE IS TEXT IN THE SEARCH BAR    
                 AShow t = new AShow(lstv_Favorites.SelectedItems[0].ToString());
                 t.Episode += 1;
                 string searchword = t.ToString();
                 if (searchword != string.Empty) { txtbx_Search.Text = searchword; }
                 else lblSearch.Text = "The search bar is empty because the selected Fav. item is empty!";
                 bgw_Search.RunWorkerAsync(searchword);
             }
             else lblSearch.Text = "I'm still searching. Please Wait :)";//need to cancel and start new search
         }
         else lblSearch.Text = "No WiFi!";
     }
 }