Share via


DevicePropertyFactory.CreateAlertsProperty Method (Int32, Int32, Int32)

 

Create an AlertsProperty object that contains information about the number and levels of alerts that have been reported.

Namespace:   Microsoft.WindowsServerSolutions.Common.Devices
Assembly:  DevicesOM (in DevicesOM.dll)

Syntax

public static AlertsProperty CreateAlertsProperty(
    int criticalCount,
    int warningCount,
    int infoCount
)
public:
static AlertsProperty^ CreateAlertsProperty(
    int criticalCount,
    int warningCount,
    int infoCount
)
Public Shared Function CreateAlertsProperty (
    criticalCount As Integer,
    warningCount As Integer,
    infoCount As Integer
) As AlertsProperty

Parameters

  • criticalCount
    Type: System.Int32

    The number of critical alerts that have been reported.

  • warningCount
    Type: System.Int32

    The number of warning alerts that have been reported.

  • infoCount
    Type: System.Int32

    The number of informational alerts that have been reported.

Return Value

Type: Microsoft.WindowsServerSolutions.Common.Devices.AlertsProperty

An instance of AlertsProperty.

Examples

The following code example shows how to create an AlertsProperty object:

int criticalCount = 3;
int warningCount = 1;
int infoCount = 2;

// create the alerts property
AlertsProperty alertsProperty = 
   DevicePropertyFactory.CreateAlertsProperty(
      criticalCount, 
      warningCount, 
      infoCount);

Console.WriteLine("Total Alert Count = {0}",      
   alertsProperty.TotalAlertCount);
Console.WriteLine("Critical Alert Count = {0}", 
   alertsProperty.CriticalAlertCount);
Console.WriteLine("Warning Alert Count = {0}", 
   alertsProperty.WarningAlertCount);
Console.WriteLine("Informational Alert Count = {0}", 
   alertsProperty.InformationAlertCount);

// expected output:
// Total Alert Count = 6
// Critical Alert Count = 3
// Warning Alert Count = 1
// Informational Alert Count = 2

See Also

DevicePropertyFactory Class
Microsoft.WindowsServerSolutions.Common.Devices Namespace

Return to top