RegisterResources() private method

private RegisterResources ( ) : void
return void
コード例 #1
0
        public void TestListApps()
        {
            if (!WindowsUtils.IsWindowsVista) Assert.Ignore("Restart Manager only available on Windows Vista or higher");

            using (var restartManager = new WindowsRestartManager())
            {
                restartManager.RegisterResources(@"C:\Windows\explorer.exe");
                restartManager.ListApps(new SilentTaskHandler());
            }
        }
コード例 #2
0
        /// <summary>
        /// Uses the <see cref="WindowsRestartManager"/> to shut down applications holding references to files we want to update.
        /// </summary>
        private void RestartManagerShutdown()
        {
            if (!WindowsUtils.IsWindowsVista) return;

            _restartManager = new WindowsRestartManager();
            _restartManager.RegisterResources(GetFilesToWrite());
            _restartManager.RegisterResources(GetFilesToDelete());
            _restartManager.ShutdownApps(new SilentTaskHandler());
        }