예제 #1
0
        public static void Show(IUpdatetable applicationInfo, string title, string message, MessageBoxInfoType type)
        {
            MessageBoxUpdater messagebox = new MessageBoxUpdater(title, message, type);

            messagebox.Owner = applicationInfo.Context;
            messagebox.ShowDialog();
        }
예제 #2
0
        public MainUpdater(IUpdatetable applicationInfo)
        {
            this.applicationInfo = applicationInfo;

            backgrounWorker                     = new BackgroundWorker();
            backgrounWorker.DoWork             += BackgrounWorker_DoWork;
            backgrounWorker.RunWorkerCompleted += BackgrounWorker_RunWorkerCompleted;
        }
예제 #3
0
        public UpdateInfo(IUpdatetable applicationInfo, UpdateXml updateInfo)
        {
            InitializeComponent();

            if (applicationInfo.ApplicationIcon != null)
            {
                this.Icon = applicationInfo.ApplicationIcon;
            }

            this.Title = applicationInfo.ApplicationName + " - Информация по обновлению";
            this.currentVersion_lb.Text = string.Format("Текущая версия: {0}", applicationInfo.ApplicationAssemby.GetName().Version.ToString());
            this.latestVersion_lb.Text  = string.Format("Новая версия: {0}", updateInfo.Version.ToString());
            this.description_tb.Text    = updateInfo.Description;
        }
예제 #4
0
        private void BackgrounWorker_DoWork(object sender, DoWorkEventArgs e)
        {
            IUpdatetable applicationInfo = (IUpdatetable)e.Argument;

            if (!UpdateXml.ExistsOnServer(applicationInfo.UpdateXmlLocation))
            {
                e.Cancel = true;
                UpdateMessageBox.Show(applicationInfo, "Проверка обновления", "Обновления отсутствуют", MessageBoxInfoType.Info);
            }
            else
            {
                e.Result = UpdateXml.Parse(applicationInfo.UpdateXmlLocation, applicationInfo.ApplicationID);
            }
        }
예제 #5
0
        public UpdateAccept(IUpdatetable applicationInfo, UpdateXml updateInfo)
        {
            InitializeComponent();

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

            this.Title = this.applicationInfo.ApplicationName + " - Обновление доступно";

            if (this.applicationInfo.ApplicationIcon != null)
            {
                this.Icon = this.applicationInfo.ApplicationIcon;
            }

            newversion_tb.Text = string.Format("Новая версия: {0}", this.updateInfo.Version.ToString());
        }