Provides an interface to the Windows Restart Manager. Supported on Windows Vista or newer.
More...
Provides an interface to the Windows Restart Manager. Supported on Windows Vista or newer.
See https://msdn.microsoft.com/en-us/library/windows/desktop/cc948910
◆ WindowsRestartManager()
NanoByte.Common.Native.WindowsRestartManager.WindowsRestartManager |
( |
| ) |
|
|
inline |
Starts a new Restart Manager session.
- Exceptions
-
Win32Exception | The Restart Manager API returned an error. |
PlatformNotSupportedException | The current platform does not support the Restart Manager. Needs Windows Vista or newer. |
◆ Dispose()
void NanoByte.Common.Native.WindowsRestartManager.Dispose |
( |
| ) |
|
|
inline |
Ends the Restart Manager session.
◆ ListApps()
string [] NanoByte.Common.Native.WindowsRestartManager.ListApps |
( |
ITaskHandler |
handler | ) |
|
|
inline |
Gets a list of all applications that are currently using resources that have been registered with RegisterResources.
- Exceptions
-
IOException | The Restart Manager could not access the registry. |
TimeoutException | The Restart Manager could not obtain a Registry write mutex in the allotted time. A system restart is recommended. |
Win32Exception | The Restart Manager API returned an error. |
◆ RegisterResources()
void NanoByte.Common.Native.WindowsRestartManager.RegisterResources |
( |
params string[] |
files | ) |
|
|
inline |
Registers resources to the Restart Manager session. The Restart Manager uses the list of resources registered with the session to determine which applications and services must be shut down and restarted.
- Parameters
-
files | An array of full filename paths. |
- Exceptions
-
Win32Exception | The Restart Manager API returned an error. |
◆ RestartApps()
void NanoByte.Common.Native.WindowsRestartManager.RestartApps |
( |
ITaskHandler |
handler | ) |
|
|
inline |
Restarts applications that have been shut down by ShutdownApps and that have been registered to be restarted.
- Parameters
-
handler | A callback object used to report progress to the user and allow cancellation. |
- Exceptions
-
IOException | One or more applications could not be automatically restarted. |
Win32Exception | The Restart Manager API returned an error. |
◆ ShutdownApps()
void NanoByte.Common.Native.WindowsRestartManager.ShutdownApps |
( |
ITaskHandler |
handler | ) |
|
|
inline |
Initiates the shutdown of applications that are currently using resources that have been registered with RegisterResources.
- Parameters
-
handler | A callback object used to report progress to the user and allow cancellation. |
- Exceptions
-
UnauthorizedAccessException | One or more applications could not be shut down. Trying again as administrator may help. |
IOException | One or more applications could not be shut down. A system reboot may be required. |
Win32Exception | The Restart Manager API returned an error. |
The documentation for this class was generated from the following file:
- Common/Native/WindowsRestartManager.cs