Alert.Suppress Method (Boolean)
Specifies whether the alert is suppressed.
Namespace: Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework
Assembly: AlertFramework (in AlertFramework.dll)
Syntax
public void Suppress(
bool value
)
public:
void Suppress(
bool value
)
Public Sub Suppress (
value As Boolean
)
Parameters
value
Type: System.Booleantrue if the alert is suppressed; otherwise, false.
Examples
The following code example shows how to get an instance of an alert object and then 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.Suppress(!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