ActivityMonitorAttribute Class

Definition

This attribute declares that an Activity class should be run as a monitor activity.

C#
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Interface, AllowMultiple=false, Inherited=false)]
public sealed class ActivityMonitorAttribute : Attribute
Inheritance
ActivityMonitorAttribute
Attributes

Examples

C#
[Activity("Monitor Computer")]  
[ActivityMonitor(Interval=15)]  
public class MonitorComputer  
{  
    private IPAddress computer;  

    [ActivityInput("Hostname or Adress")]  
    public IPAddress Computer  
    {  
        set { computer = value; }  
    }  

    [ActivityOutput]  
    IPStatus Status  
    {  
        get { new Ping().Send(computer).Status; }  
    }  
}  

Remarks

Monitor activities, unlike standard task activities, will be invoked repeatedly until the workflow that contains them is stopped. Furthermore, your object will be kept alive until the workflow is stopped which means that that any state information will be maintained between subsequent invocations.

Constructors

ActivityMonitorAttribute()

Initializes a new instance of the ActivityMonitorAttributeclass

Properties

Applies to

Tuote Versiot
System Center Orch SDK 2012, 2016