ActivityMethodAttribute Class

Marks a method inside an Activity class as one that should be run when the activity is invoked by Orchestrator.

Namespace: Microsoft.SystemCenter.Orchestrator.Integration
Assembly: Microsoft.SystemCenter.Orchestrator.Integration (in Microsoft.SystemCenter.Orchestrator.Integration.dll)

Usage

'Usage
Dim instance As ActivityMethodAttribute

Syntax

'Declaration
<AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple:=False, Inherited:=False)> _
Public NotInheritable Class ActivityMethodAttribute
    Inherits Attribute
[AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple=false, Inherited=false)] 
public sealed class ActivityMethodAttribute : Attribute
[AttributeUsageAttribute(AttributeTargets::Method, AllowMultiple=false, Inherited=false)] 
public ref class ActivityMethodAttribute sealed : public Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple=false, Inherited=false) */ 
public final class ActivityMethodAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple=false, Inherited=false) 
public final class ActivityMethodAttribute extends Attribute

Example

using Microsoft.SystemCenter.Orchestrator.Integration;
using System.IO.File;

[Activity("Copy File")]
public class CopyFile
{
    private FileInfo source;
    private FileInfo destination;
    private bool overwrite;

    [ActivityInput]
    public FileInfo Source { set { source = value; } }

    [ActivityInput]
    public FileInfo Destination { set { destination = value; } }

    [ActivityInput]
    public Boolean Overwrite { set { overwrite = value; } }

    [ActivityMethod]
    public void Run()
    {
        source.CopyTo(destination, overwrite);
    }
}

Remarks

You can mark as many methods with the ActivityMethod attribute as required, although the order in which they will be invoked by Orchestrator is undefined.

Methods marked with the ActivityMethod attribute must be public, take no parameters and return void.

Inheritance Hierarchy

System.Object
   System.Attribute
    Microsoft.SystemCenter.Orchestrator.Integration.ActivityMethodAttribute

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows Server 2003, and

Target Platforms

Change History

See Also

Reference

ActivityMethodAttribute Members
Microsoft.SystemCenter.Orchestrator.Integration Namespace