次の方法で共有


LocalAlertManager.GetLocalAlert Method (String, String)

 

Returns an alert, if it is exists, for the specified feature and health definition that is defined on the local computer.

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

Syntax

public Alert GetLocalAlert(
    string featureName,
    string healthDefinitionName
)
public:
Alert^ GetLocalAlert(
    String^ featureName,
    String^ healthDefinitionName
)
Public Function GetLocalAlert (
    featureName As String,
    healthDefinitionName As String
) As Alert

Parameters

  • healthDefinitionName
    Type: System.String

    The name of the health definition

Return Value

Type: Microsoft.WindowsServerSolutions.NetworkHealth.AlertFramework.Alert

An instance of Alert.

Exceptions

Exception Condition
AlertProviderException

Communication or connection errors occurred when calling the Alert Provider.

InvalidOperationException

The method was called from the Windows UI thread

Examples

The following code example shows how to get a local alert:

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

Alert alert = localAlertManager.GetLocalAlert(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