- clipz.zip
- Clipz.sln
- Clipz
- Core
- AppRestartRecovery
- Core.csproj
- Dialogs
- Common
- TaskDialogs
- Interop
- NetworkList
- PowerManagement
- Properties
- PropertySystem
- SafeHandles
- Libraries
- StructureMap.dll
- Shell
- Common
- CommonFileDialogs
- Controls
- Design
- ShellObjects.cd
- ShellThumbnailClassDiagram.cd
- DesktopWindowManager
- ExplorerBrowser
- Interop
- Common
- Dialogs
- ExplorerBrowser
- KnownFolders
- PropertySystem
- StockIcons
- Taskbar
- KnownFolders
- Properties
- PropertySystem
- Shell.csproj
- StockIcons
- Taskbar
|
//Copyright (c) Microsoft Corporation. All rights reserved.
using System;
namespace Microsoft.WindowsAPICodePack.ApplicationServices
{
/// <summary>
/// Defines methods and properties for recovery settings, and specifies options for an application that attempts
/// to perform final actions after a fatal event, such as an
/// unhandled exception.
/// </summary>
/// <remarks>This class is used to register for application recovery.
/// See the <see cref="ApplicationRestartRecoveryManager"/> class.
/// </remarks>
public class RecoverySettings
{
private RecoveryData recoveryData;
private uint pingInterval;
/// <summary>
/// Initializes a new instance of the <b>RecoverySettings</b> class.
/// </summary>
/// <param name="data">A recovery data object that contains the callback method (invoked by the system
/// before Windows Error Reporting terminates the application) and an optional state object.</param>
/// <param name="interval">The time interval within which the
/// callback method must invoke <see cref="ApplicationRestartRecoveryManager.ApplicationRecoveryInProgress"/> to
/// prevent WER from terminating the application.</param>
/// <seealso cref="ApplicationRestartRecoveryManager"/>
public RecoverySettings(RecoveryData data, uint interval)
{
this.recoveryData = data;
this.pingInterval = interval;
}
/// <summary>
/// Gets the recovery data object that contains the callback method and an optional
/// parameter (usually the state of the application) to be passed to the
/// callback method.
/// </summary>
/// <value>A <see cref="RecoveryData"/> object.</value>
public RecoveryData RecoveryData
{
get { return recoveryData; }
}
/// <summary>
/// Gets the time interval for notifying Windows Error Reporting.
/// The <see cref="RecoveryCallback"/> method must invoke <see cref="ApplicationRestartRecoveryManager.ApplicationRecoveryInProgress"/>
/// within this interval to prevent WER from terminating the application.
/// </summary>
/// <remarks>
/// The recovery ping interval is specified in milliseconds.
/// By default, the interval is 5 seconds.
/// If you specify zero, the default interval is used.
/// </remarks>
public uint PingInterval
{
get { return pingInterval; }
}
/// <summary>
/// Returns a string representation of the current state
/// of this object.
/// </summary>
/// <returns>A <see cref="System.String"/> object.</returns>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object,System.Object)",
Justification = "We are not currently handling globalization or localization")]
public override string ToString()
{
return String.Format("delegate: {0}, state: {1}, ping: {2}",
this.recoveryData.Callback.Method.ToString(),
this.recoveryData.State.ToString(),
this.PingInterval);
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm the founder of PageLabs, a web-based performance and SEO optimization site.
Give your site a boost in performance, even take a free speed test!
http://www.pagelabs.com