示例#1
0
        public GuacUpdater(IGuacUpdatable applicationInfo)
        {
            this.applicationInfo = applicationInfo;

            this.bgWorker                     = new BackgroundWorker();
            this.bgWorker.DoWork             += new DoWorkEventHandler(bgWorker_DoWork);
            this.bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(BgWorker_RunWorkerCompleted);
        }
示例#2
0
        private void bgWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            IGuacUpdatable application = (IGuacUpdatable)e.Argument;

            if (!GuacUpdateXml.ExistsOnServer(application.UpdateXmlLocation))
            {
                e.Cancel = true;
            }
            else
            {
                e.Result = GuacUpdateXml.Parse(application.UpdateXmlLocation, application.ApplicationID);
            }
        }
        internal GuacUpdateInfoForm(IGuacUpdatable applicationInfo, GuacUpdateXml updateInfo)
        {
            InitializeComponent();

            try
            {
                config = JsonConvert.DeserializeObject(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "Data/config.json"));
            }
            catch
            {
                MessageBox.Show("Could not read config file, either fix it or redownload the file", "Guac");
                Application.Exit();
            }

            UpdateTheme();

            this.Text                = applicationInfo.ApplicationName + " - Update Info";
            this.lblVersions.Text    = String.Format("Current Version: {0}\nUpdate Version: {1}", applicationInfo.ApplicationAssembly.GetName().Version.ToString(), updateInfo.Version.ToString());
            this.txtDescription.Text = updateInfo.Description;
        }
示例#4
0
        internal GuacUpdateAcceptForm(IGuacUpdatable applicationInfo, GuacUpdateXml updateInfo)
        {
            InitializeComponent();

            try
            {
                config = JsonConvert.DeserializeObject(File.ReadAllText(AppDomain.CurrentDomain.BaseDirectory + "Data/config.json"));
            }
            catch
            {
                MessageBox.Show("Could not read config file, either fix it or redownload the file", "Guac");
                Application.Exit();
            }

            UpdateTheme();

            this.applicationInfo = applicationInfo;
            this.updateInfo      = updateInfo;

            this.Text = this.applicationInfo.ApplicationName + " - Update Available";

            this.lblNewVersion.Text = string.Format("New Version: {0}", this.updateInfo.Version.ToString());
        }