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