MainForm.cs
author StephaneLenclud
Sat, 16 May 2015 01:31:32 +0200
changeset 5 29ccfbf98e54
parent 4 8372aa8d6292
child 7 bf908f6c7758
permissions -rw-r--r--
Group support and multiple package import.
     1 using System;
     2 using System.Collections.Generic;
     3 using System.ComponentModel;
     4 using System.Data;
     5 using System.Drawing;
     6 using System.Linq;
     7 using System.Text;
     8 using System.Threading.Tasks;
     9 using System.Windows.Forms;
    10 using CsQuery;
    11 using System.Diagnostics;
    12 using System.Net;
    13 
    14 
    15 
    16 namespace SatChanGen
    17 {
    18     public partial class MainForm : Form
    19     {
    20         public MainForm()
    21         {
    22             InitializeComponent();
    23         }
    24 
    25         private void buttonGenerate_Click(object sender, EventArgs e)
    26         {
    27             List<Channel> channels = new List<Channel>();
    28             channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-skygermany.php", "19.2°E"));
    29             channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-hdplus.php", "19.2°E"));
    30             channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-arddigital.php", "19.2°E"));
    31             channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-zdfvision.php", "19.2°E"));
    32             channels.AddRange(KingOfSat.Parse(channels, "http://en.kingofsat.net/pack-tntsat.php", "19.2°E"));
    33         
    34             //Discard non HD channels we don't need
    35             channels = KingOfSat.CleanChannelList(channels);
    36 
    37             //Declare tuner cards so that we don't need to create mapping manually after import
    38             List<string> tuners = new List<string>(){"3","4"};
    39 
    40             //Export to XML for MediaPortal to import
    41             MediaPortal.Export(channels, tuners, "channels.xml", false);
    42         }
    43     }
    44 }