public UpdateWindow(Updater updater, UpdaterApp app)
        {
            InitializeComponent();

              Title = string.Format("Update to v.{0}", app.Version);
              m_Updater = updater;
              m_App = app;
              m_Updater.DownloadingDelegate += Download;
              m_Updater.DownloadCompletedDelegate += DownloadCompleted;

              m_Updater.Download(m_App.Url, string.Format("{0}\\temp\\{1}", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), m_App.FileName));
        }
Example #2
0
        public UpdateWindow(Updater updater, UpdaterApp app)
        {
            InitializeComponent();

              Title = string.Format("Update to v.{0}", app.Version);
              m_Updater = updater;
              m_App = app;
              m_Updater.DownloadingDelegate += Download;
              m_Updater.DownloadCompletedDelegate += DownloadCompleted;
              m_Updater.DownloadFailedDelegate += DownloadFailed;

              m_Updater.Download(m_App.Url, string.Format("{0}\\{1}", System.IO.Path.GetTempPath(), m_App.FileName));
        }
Example #3
0
        private void CheckCompleted(UpdaterApp app)
        {
            m_App = app;
              Dispatcher.BeginInvoke(new Action(() =>
              {
            btnCheck.IsEnabled = true;

            if (m_App != null) {
              btnDownload.IsEnabled = true;
              txtOutput.AppendText(string.Format("Name: {0}\r\n", app.Name));
              txtOutput.AppendText(string.Format("Version: {0}\r\n", app.Version));
              txtOutput.AppendText(string.Format("File name: {0}\r\n", app.FileName));
              txtOutput.AppendText(string.Format("Released: {0}\r\n", app.ReleaseDate));
              txtOutput.AppendText(string.Format("Url: {0}\r\n", app.Url));
              txtOutput.AppendText("Changelog:\r\n");
              txtOutput.AppendText(string.Format("{0}\r\n", app.Changelog));
              txtOutput.AppendText("Message:\r\n");
              txtOutput.AppendText(string.Format("{0}\r\n", app.Message));
            } else {
              txtOutput.AppendText("Application not found\r\n");
            }
              }));
        }
Example #4
0
 private void CheckCompleted(UpdaterApp app)
 {
   m_App = app;
   Dispatcher.BeginInvoke(new Action(() =>
   {
     btnCheckUpdates.IsEnabled = true;
     if (m_App != null && m_App.Version > Assembly.GetExecutingAssembly().GetName().Version) {
       UpdateConfirmWindow cdlg = new UpdateConfirmWindow(m_App);
       cdlg.Owner = this;
       if (cdlg.ShowDialog() == true){
         UpdateWindow dlg = new UpdateWindow(m_Updater, m_App);
         dlg.Owner = this;
         dlg.ShowDialog();
       }
     }
   }));
 }