LocalAlertManager.RaiseLocalAlertAsync Method (String, String, String)
Asynchronously raises an alert for a health definition that is defined on the local computer.
Namespace: Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework
Assembly: AlertFramework (in AlertFramework.dll)
Syntax
public void RaiseLocalAlertAsync(
string featureName,
string healthDefinitionName,
string description
)
public:
void RaiseLocalAlertAsync(
String^ featureName,
String^ healthDefinitionName,
String^ description
)
Public Sub RaiseLocalAlertAsync (
featureName As String,
healthDefinitionName As String,
description As String
)
Parameters
featureName
Type: System.StringThe name of the feature
healthDefinitionName
Type: System.StringThe name of the health definition.
description
Type: System.StringThe description of the alert.
Remarks
Subscribe to the RaiseLocalAlertCompleted event to be notified when this method finishes.
Examples
The following code example shows how to asynchronously raise a local alert:
string featureName = "FeatureName";
string healthDefinitionName = "HealthDefinitionName";
string description = "Description";
LocalAlertManager localAlertManager = new LocalAlertManager();
localAlertManager.RaiseLocalAlertCompleted +=
new EventHandler<RaiseAlertCompletedEventArgs>(
localAlertManager_RaiseAlertCompleted);
localAlertManager.RaiseLocalAlertAsync(
featureName, healthDefinitionName, description);
Note
The FeatureName and the HealthDefinitionName are defined in the Definition.xml file for the add-in.
The following code example shows the delegate method:
static void localAlertManager_RaiseAlertCompleted(
object sender, EventArgs e)
{
Console.WriteLine("Raised Alerts...");
}
See Also
RaiseLocalAlertAsync Overload
LocalAlertManager Class
Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework Namespace
Return to top