public UpdateManager( IApplicationState applicationState, IApplicationWindowState applicationWindowState, IUserActivityMonitor userActivityMonitor, IUpdateCheckerFactory updateCheckerFactory, IProcessStartProvider processStartProvider, IUpdatePromptProvider updatePromptProvider, Func <IUpdateVariantHandler> updateVariantHandlerFactory) { this.applicationState = applicationState; this.applicationWindowState = applicationWindowState; this.userActivityMonitor = userActivityMonitor; this.updateCheckerFactory = updateCheckerFactory; this.processStartProvider = processStartProvider; this.updatePromptProvider = updatePromptProvider; this.updateVariantHandlerFactory = updateVariantHandlerFactory; this.promptTimer = new DispatcherTimer(); this.promptTimer.Tick += this.PromptTimerElapsed; // Strategy time: // We'll prompt the user a fixed period after the computer starts up / resumes from sleep // We'll also check on a fixed interval since this point // We'll also check when the application is restored from tray this.applicationState.Startup += this.ApplicationStartup; this.applicationState.ResumeFromSleep += this.ResumeFromSleep; this.applicationWindowState.RootWindowActivated += this.RootWindowActivated; }
public UpdateManager( IApplicationState applicationState, IApplicationWindowState applicationWindowState, IUserActivityMonitor userActivityMonitor, IUpdateCheckerFactory updateCheckerFactory, IProcessStartProvider processStartProvider, IUpdatePromptProvider updatePromptProvider, IAssemblyProvider assemblyProvider, Func<IUpdateVariantHandler> updateVariantHandlerFactory) { this.applicationState = applicationState; this.applicationWindowState = applicationWindowState; this.userActivityMonitor = userActivityMonitor; this.updateCheckerFactory = updateCheckerFactory; this.processStartProvider = processStartProvider; this.updatePromptProvider = updatePromptProvider; this.assemblyProvider = assemblyProvider; this.updateVariantHandlerFactory = updateVariantHandlerFactory; this.promptTimer = new DispatcherTimer(); this.promptTimer.Tick += this.PromptTimerElapsed; // Strategy time: // We'll prompt the user a fixed period after the computer starts up / resumes from sleep // (this is handled by CheckForUpdates being set to true, if appropriate, by another part of the application) // We'll also check on a fixed interval since this point // If 'remind me later' is active, we'll also check when the application is restored from tray this.applicationState.ResumeFromSleep += this.ResumeFromSleep; this.applicationWindowState.RootWindowActivated += this.RootWindowActivated; }
public UpdateManager( IApplicationState applicationState, IApplicationWindowState applicationWindowState, IUserActivityMonitor userActivityMonitor, IUpdateCheckerFactory updateCheckerFactory, IProcessStartProvider processStartProvider, IUpdatePromptProvider updatePromptProvider, Func<IUpdateVariantHandler> updateVariantHandlerFactory) { this.applicationState = applicationState; this.applicationWindowState = applicationWindowState; this.userActivityMonitor = userActivityMonitor; this.updateCheckerFactory = updateCheckerFactory; this.processStartProvider = processStartProvider; this.updatePromptProvider = updatePromptProvider; this.updateVariantHandlerFactory = updateVariantHandlerFactory; this.promptTimer = new DispatcherTimer(); this.promptTimer.Tick += this.PromptTimerElapsed; // Strategy time: // We'll prompt the user a fixed period after the computer starts up / resumes from sleep // We'll also check on a fixed interval since this point // We'll also check when the application is restored from tray this.applicationState.Startup += this.ApplicationStartup; this.applicationState.ResumeFromSleep += this.ResumeFromSleep; this.applicationWindowState.RootWindowActivated += this.RootWindowActivated; }
public UpdateManager( IApplicationState applicationState, IApplicationWindowState applicationWindowState, IUserActivityMonitor userActivityMonitor, IUpdateCheckerFactory updateCheckerFactory, IProcessStartProvider processStartProvider, IUpdatePromptProvider updatePromptProvider, IAssemblyProvider assemblyProvider, Func <IUpdateVariantHandler> updateVariantHandlerFactory) { this.applicationState = applicationState; this.applicationWindowState = applicationWindowState; this.userActivityMonitor = userActivityMonitor; this.updateCheckerFactory = updateCheckerFactory; this.processStartProvider = processStartProvider; this.updatePromptProvider = updatePromptProvider; this.assemblyProvider = assemblyProvider; this.updateVariantHandlerFactory = updateVariantHandlerFactory; this.promptTimer = new DispatcherTimer(); this.promptTimer.Tick += this.PromptTimerElapsed; // Strategy time: // We'll always check when the user starts up or resumes from sleep. // We'll check whenever the user opens the app, debounced to a suitable period. // We'll check periodically if none of the above have happened, on a longer interval. // If 'remind me later' is active, we'll do none of the above for a long interval. this.applicationState.ResumeFromSleep += this.ResumeFromSleep; this.applicationWindowState.RootWindowActivated += this.RootWindowActivated; }