summaryrefslogtreecommitdiffstats
path: root/win/C#/frmUpdater.cs
blob: 82fe2f3b6f53093f372568d0072cd21b0e82408a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Net;

namespace Handbrake
{
    public partial class frmUpdater : Form
    {
        Functions.RssReader rssRead = new Functions.RssReader();
        public frmUpdater()
        {
            InitializeComponent();
          
            getRss();
            setVersions();
        }

        private void getRss()
        { 
            wBrowser.DocumentText = "<font face=\"verdana\" size=\"1\">" + rssRead.versionInfo() + "</font>";
        }

        private void setVersions()
        {
            lbl_oldVersion.Text = "(you have: " + Properties.Settings.Default.CliVersion + " / " + Properties.Settings.Default.build  + ").";
            lbl_newVersion.Text = rssRead.version() + " (" + rssRead.build() + ")";
        }

        private void btn_installUpdate_Click(object sender, EventArgs e)
        {
            frmDownload download = new frmDownload();
            download.Show();
            this.Close(); 
        }

        private void btn_remindLater_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btn_skip_Click(object sender, EventArgs e)
        {
            try
            {
                Properties.Settings.Default.skipversion = int.Parse(rssRead.build());
                Properties.Settings.Default.Save();
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.ToString());
            }
            this.Close();
        }

    }
}