TaskStatusChangedEventArgs Class

Provides data for the TaskStateChanged event.
Inheritance Hierarchy
SystemObject
  SystemEventArgs
    AGI.Parallel.ClientTaskStatusChangedEventArgs
Namespace:  AGI.Parallel.Client
Assembly:  AGI.Parallel.Client (in AGI.Parallel.Client.dll) Version: 1.4.0.476 (1.4.0.476)
Syntax
public class TaskStatusChangedEventArgs : EventArgs

The TaskStatusChangedEventArgs type exposes the following members.

Constructors
  Name Description
Public method TaskStatusChangedEventArgs
Initializes a new instance of the TaskStatusChangedEventArgs class.
Top
Properties
  Name Description
Public property NewStatus
Gets the new task status.
Public property PreviousStatus
Gets the previous task status.
Public property State
Gets the state of the task.
Public property Task
Gets the task that has changed state.
Top
Methods
  Name Description
Public method Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected method Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public method GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Examples
using System;
using AGI.Parallel.Client;
using AGI.Parallel.Infrastructure;

namespace CodeSamples
{
    class Program
    {
        static void Main(string[] args)
        {
            using (IJobScheduler scheduler = new ClusterJobScheduler("localhost"))
            {
                scheduler.Connect();

                Job job = scheduler.CreateJob();
                job.AddTask(new OurTask());
                job.TaskStateChanged += new EventHandler<TaskStatusChangedEventArgs>(OnTaskStatusChangedEventHandler);
                job.Submit();
                job.WaitUntilDone();
            }
        }

        private static void OnTaskStatusChangedEventHandler(object sender, TaskStatusChangedEventArgs taskState)
        {
            Console.WriteLine("Task Name: " + taskState.Task.Name);
            Console.WriteLine("Status changed from " + taskState.PreviousStatus + " to " + taskState.NewStatus);
        }
    }

    [Serializable]
    class OurTask : Task
    {
        public override void Execute()
        {
        }
    }
}
See Also

STK Scalability 1.4 API for .NET