次の方法で共有


Alert.SuppressAsync Method (Boolean)

 

Specifies whether the alert is suppressed.

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

Syntax

public void SuppressAsync(
    bool value
)
public:
void SuppressAsync(
    bool value
)
Public Sub SuppressAsync (
    value As Boolean
)

Parameters

  • value
    Type: System.Boolean

    true if the alert is suppressed; otherwise, false.

Examples

The following code example shows how to get an instance of an alert object and then asynchronously suppress the alert if it is not currently suppressed:

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

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

//If the alert is not suppressed, suppress it alert.SuppressAsync(!alert.IsSuppressed);

Note

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

See Also

LocalAlertManager
Alert Class
Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework Namespace

Return to top