Ejemplo n.º 1
0
 private void listBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         var itemselected = (ListBoxItem) listBox.SelectedItem;
         switch (itemselected.Tag.ToString())
         {
             case "mangafox":
             {
                 var name_chapter = itemselected.Content.ToString().Split(new[] {" : "}, StringSplitOptions.None);
                 var _openSite = new OpenSite();
                 _openSite.Open("mangafox", name_chapter[0], name_chapter[1], mlist);
                 DebugText(
                     $"[{DateTime.Now}][Debug] Opened {itemselected.Content} on {itemselected.Tag.ToString().ToUpper()}.");
                 break;
             }
             case "mangareader":
             {
                 var name_chapter = itemselected.Content.ToString().Split(new[] {" : "}, StringSplitOptions.None);
                 var _openSite = new OpenSite();
                 _openSite.Open("mangareader", name_chapter[0], name_chapter[1], mlist);
                 DebugText(
                     $"[{DateTime.Now}][Debug] Opened {itemselected.Content} on {itemselected.Tag.ToString().ToUpper()}.");
                 break;
             }
             case "batoto":
             {
                 var name_chapter = itemselected.Content.ToString().Split(new[] {" : "}, StringSplitOptions.None);
                 var _openSite = new OpenSite();
                 _openSite.Open("batoto", name_chapter[0], name_chapter[1], mlist);
                 DebugText(
                     $"[{DateTime.Now}][Debug] Opened {itemselected.Content} on {itemselected.Tag.ToString().ToUpper()}.");
                 break;
             }
         }
     }
     catch (Exception g)
     {
         //do nothing
         DebugText($"[{DateTime.Now}][Error] {g.Message} {g.TargetSite} ");
     }
     finally
     {
         switch (_siteSelected)
         {
             case "mangastream":
             {
                 //nothing
                 break;
             }
             case "mangareader":
             {
                 listBox.Items.Clear();
                 FillMangareader();
                 break;
             }
             case "mangafox":
             {
                 listBox.Items.Clear();
                 FillMangafox();
                 break;
             }
             case "all":
             {
                 listBox.Items.Clear();
                 Fill_list();
                 break;
             }
             case "batoto":
             {
                 listBox.Items.Clear();
                 Fillbatoto();
                 break;
             }
         }
     }
 }
Ejemplo n.º 2
0
 private void OpenSite(string site, string name, string chapter)
 {
     var open = new OpenSite();
     open.Open(site, name, chapter, mlist);
     switch (_siteSelected)
     {
         case "mangastream":
         {
             //nothing
             break;
         }
         case "mangareader":
         {
             listBox.Items.Clear();
             FillMangareader();
             break;
         }
         case "mangafox":
         {
             listBox.Items.Clear();
             FillMangafox();
             break;
         }
         case "all":
         {
             listBox.Items.Clear();
             Fill_list();
             break;
         }
         case "batoto":
         {
             listBox.Items.Clear();
             Fillbatoto();
             break;
         }
     }
 }