Esempio n. 1
1
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (!loadConfigFile())
            {
                MessageBox.Show("Can't read configuration file!");
                Application.Exit();
            }
            try
            {
                project_uri = new Uri(getCfgValue("projecturl"));
            }
            catch (UriFormatException)
            {
                MessageBox.Show("Malformed projecturl tag in the configuration file!");
                Application.Exit();
            }

            var value = new Uri(project_uri, getCfgValue("updates_page_url", "updates.html"));            

            webBrowser1.Navigate(value); 
            update_state = UpdateStates.Ready;

            this.Text = getCfgValue("application_title");

            runWhenFinished = (RunApplications)getCfgValueInt("runWhenFinished");

            workInBackground.DoWork += new DoWorkEventHandler(UpdateTheClient);
            workInBackground.RunWorkerCompleted += new RunWorkerCompletedEventHandler(UpdateTheClientCompleted);
            workInBackground.ProgressChanged += new ProgressChangedEventHandler(UpdateTheClientProgressChanged);
        }
Esempio n. 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            if (!loadConfigFile())
            {
                MessageBox.Show("Can't read configuration file!");
                Application.Exit();
            }
            try
            {
                project_uri = new Uri(getCfgValue("projecturl"));
            }
            catch (UriFormatException)
            {
                MessageBox.Show("Malformed projecturl tag in the configuration file!");
                Application.Exit();
            }

            var value = new Uri(project_uri, getCfgValue("updates_page_url", "updates.html"));

            webBrowser1.Navigate(value);
            update_state = UpdateStates.Ready;

            this.Text = getCfgValue("application_title");

            runWhenFinished = (RunApplications)getCfgValueInt("runWhenFinished");

            workInBackground.DoWork             += new DoWorkEventHandler(UpdateTheClient);
            workInBackground.RunWorkerCompleted += new RunWorkerCompletedEventHandler(UpdateTheClientCompleted);
            workInBackground.ProgressChanged    += new ProgressChangedEventHandler(UpdateTheClientProgressChanged);
        }