Inheritance: IDisposable
Exemplo 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();
            }
        }
Exemplo n.º 2
0
 public static Task ApplyUpdateIfAvailableAsync(UpdateManager updateManager)
 {
     var updateTask = updateManager.CheckForUpdatesAsync();
     return updateTask;
 }