Ejemplo n.º 1
0
        private static void ShowUI()
        {
            var         updateForm = new UpdateForm();
            CultureInfo ci         = Thread.CurrentThread.CurrentUICulture;

            updateForm.ShowDialog();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Shows standard update dialog.
        /// </summary>
        public static void ShowUpdateForm(UpdateInfoEventArgs args)
        {
            if (UpdateFormType == null)
            {
                using (var updateForm = new UpdateForm(args))
                {
                    if (UpdateFormSize.HasValue)
                    {
                        updateForm.Size = UpdateFormSize.Value;
                    }

                    if (updateForm.ShowDialog().Equals(DialogResult.OK))
                    {
                        Exit();
                    }
                }
            }
            else
            {
                var form = (IForm)Activator.CreateInstance(UpdateFormType, args);
                var ret  = form.ShowDialog();

                if (ret.HasValue &&
                    ret.Value == true)
                {
                    Exit();
                }

                Running = false;
            }
        }
Ejemplo n.º 3
0
        private static void ShowUpdateForm()
        {
            var updateForm = new UpdateForm();

            if (updateForm.ShowDialog().Equals(DialogResult.OK))
            {
                Exit();
            }
        }
Ejemplo n.º 4
0
        private static void ShowUI()
        {
            Task.Run(() =>
            {
                var updateForm = new UpdateForm();

                updateForm.ShowDialog();

                updateForm.Dispose();
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Shows standard update dialog.
        /// </summary>
        public static void ShowUpdateForm()
        {
            var updateForm = new UpdateForm();
            if (UpdateFormSize.HasValue)
            {
                updateForm.Size = UpdateFormSize.Value;
            }

            if (updateForm.ShowDialog().Equals(DialogResult.OK))
            {
                Exit();
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     Shows standard update dialog.
        /// </summary>
        public static void ShowUpdateForm(UpdateInfoEventArgs args)
        {
            using (var updateForm = new UpdateForm(args))
            {
                if (UpdateFormSize.HasValue)
                {
                    updateForm.Size = UpdateFormSize.Value;
                }

                if (updateForm.ShowDialog().Equals(DialogResult.OK))
                {
                    Exit();
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     Opens the Download window that download the update and execute the installer when download completes.
        /// </summary>
        public static bool DownloadUpdate(UpdateInfoEventArgs args)
        {
            using (var downloadDialog = new UpdateForm(args))
            {
                try
                {
                    return(downloadDialog.ShowDialog().Equals(DialogResult.OK));
                }
                catch (TargetInvocationException)
                {
                }
            }

            return(false);
        }
Ejemplo n.º 8
0
        public static void ShowUpdateForm()
        {
            var updateForm = new UpdateForm();

            var dialogResult = updateForm.ShowDialog();

            if (UpdateFormClosedEvent != null)
            {
                UpdateFormClosedEvent(new UpdateFormClosedEventArgs(dialogResult));
            }

            if (dialogResult.Equals(DialogResult.OK))
            {
                Exit();
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Shows standard update dialog.
        /// <paramref name="updateOK">Download result.</paramref>
        /// </summary>
        public static void ShowUpdateForm(ref bool updateOK)
        {
            using (var updateForm = new UpdateForm())
            {
                if (UpdateFormSize.HasValue)
                {
                    updateForm.Size = UpdateFormSize.Value;
                }

                if (updateForm.ShowDialog().Equals(DialogResult.OK))
                {
                    updateOK = true;
                    Exit();
                    return;
                }
                updateOK = false;
            }
        }
Ejemplo n.º 10
0
 private static void ShowUpdateForm()
 {
     if (Mandatory)
     {
         if (DownloadUpdate())
         {
             if (NeedRestart)
             {
                 Exit();
             }
         }
     }
     else
     {
         var updateForm = new UpdateForm();
         if (updateForm.ShowDialog().Equals(DialogResult.OK))
         {
             if (NeedRestart)
             {
                 Exit();
             }
         }
     }
 }
Ejemplo n.º 11
0
        private static void ShowUI()
        {
            var updateForm = new UpdateForm();

            updateForm.ShowDialog();
        }
Ejemplo n.º 12
0
 private static void BackgroundWorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs)
 {
     if (!runWorkerCompletedEventArgs.Cancelled)
     {
         if (runWorkerCompletedEventArgs.Result is DateTime)
         {
             var remindLaterTime = (DateTime)runWorkerCompletedEventArgs.Result;
             SetTimer(remindLaterTime);
         }
         else
         {
             var args = runWorkerCompletedEventArgs.Result as UpdateInfoEventArgs;
             if (CheckForUpdateEvent != null)
             {
                 CheckForUpdateEvent(args);
             }
             else
             {
                 if (args != null)
                 {
                     if (args.IsUpdateAvailable)
                     {
                         if (!IsWinFormsApplication)
                         {
                             Application.EnableVisualStyles();
                         }
                         Thread thread = new Thread(new ThreadStart(delegate
                         {
                             var updateForm = new UpdateForm();
                             if (updateForm.ShowDialog().Equals(DialogResult.OK))
                             {
                                 Exit();
                             }
                         }));
                         thread.CurrentCulture = thread.CurrentUICulture = CurrentCulture;
                         thread.SetApartmentState(ApartmentState.STA);
                         thread.Start();
                         return;
                     }
                     else
                     {
                         if (ReportErrors)
                         {
                             MessageBox.Show(Resources.UpdateUnavailableMessage, Resources.UpdateUnavailableCaption,
                                             MessageBoxButtons.OK, MessageBoxIcon.Information);
                         }
                     }
                 }
                 else
                 {
                     if (ReportErrors)
                     {
                         MessageBox.Show(
                             Resources.UpdateCheckFailedMessage,
                             Resources.UpdateCheckFailedCaption, MessageBoxButtons.OK, MessageBoxIcon.Error);
                     }
                 }
             }
             Running = false;
         }
     }
 }
Ejemplo n.º 13
0
        private static void ShowUi()
        {
            var updateForm = new UpdateForm(_title, _appCastUrl, _appTitle, _currentVersion, _installedVersion, _changeLogUrl, _downloadUrl, _registryLocation, _remindLaterAt, _remindLaterFormat, _letUserSelectRemindLater);

            updateForm.ShowDialog();
        }