/// <summary> /// Callback for automatic updates. Called by the UpdateCheck thread upon completion. /// </summary> public void UpdateCheckComplete() { Dispatcher.Invoke(DispatcherPriority.Normal, new Procedure(() => { // see if an update is available if (!updateCheck.Available) { return; } // ignore if subwindows are open if (!canOpenDemo) { return; } UpdateCheckWindow window = new UpdateCheckWindow(ShowUpdateWindow, updateCheck); window.Owner = this; try { canOpenDemo = false; window.ShowDialog(); } finally { canOpenDemo = true; } })); }
private void uiCheckForUpdatesMenuItem_Click(object sender, RoutedEventArgs e) { // cancel the automatic update thread if it's already running if (updateCheck != null) { updateCheck.Cancel(); } UpdateCheckWindow window = new UpdateCheckWindow(ShowUpdateWindow) { Owner = this }; try { canOpenDemo = false; window.ShowDialog(); } finally { canOpenDemo = true; } }