Inheritance: IDisposable
Ejemplo n.º 1
0
        public static void ApplyUpdateIfAvailable(bool showUpdateUserinterface = true, int maximumSearchTimeout = 5)
        {
            using (var updateManager = new UpdateManager(maximumSearchTimeout))

            if (showUpdateUserinterface)
            {
                try
                {
                    var userInterfaceFactory = new UpdateUserInterfaceFactory(updateManager);
                    var updateInterfaceWindow = userInterfaceFactory.CreateUpdateWindow();
                    updateInterfaceWindow.ShowDialog();
                }

                catch (Exception ex)
                {
                    Debug.WriteLine(ex);
                }

            }
            else
            {
                ApplyUpdateIfAvailableAsync(updateManager).Wait();
            }
        }
Ejemplo n.º 2
0
 public static Task ApplyUpdateIfAvailableAsync(UpdateManager updateManager)
 {
     var updateTask = updateManager.CheckForUpdatesAsync();
     return updateTask;
 }