次の方法で共有


LocalAlertManager.ClearLocalAlertAsync Method (String, String)

 

Asynchronously removes an alert from the network.

Namespace:   Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework
Assembly:  AlertFramework (in AlertFramework.dll)

Syntax

public void ClearLocalAlertAsync(
    string featureName,
    string healthDefinitionName
)
public:
void ClearLocalAlertAsync(
    String^ featureName,
    String^ healthDefinitionName
)
Public Sub ClearLocalAlertAsync (
    featureName As String,
    healthDefinitionName As String
)

Parameters

  • healthDefinitionName
    Type: System.String

    The name of the health definition.

Exceptions

Exception Condition
AlertProviderException

Communication or connection errors occurred when calling the Alert Provider.

Remarks

Subscribe to the ClearLocalAlertCompleted event to be notified when this method finishes.

Examples

The following code example shows how to get an instance of an alert object and then asynchronously clear the alert:

string featureName = "FeatureName";
string healthDefinitionName = "HealthDefinitionName";
LocalAlertManager localAlertManager = new LocalAlertManager();

Alert alert = 
   localAlertManager.GetLocalAlert(featureName,healthDefinitionName); localAlertManager.ClearLocalAlertAsync(
   featureName, healthDefinitionName);

Note

The FeatureName and the HealthDefinitionName are defined in the Definition.xml file for the add-in.

See Also

LocalAlertManager Class
Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework Namespace

Return to top