TaskProgressEventArgs Class

Provides data for the TaskProgressUpdated event.
Inheritance Hierarchy
SystemObject
  SystemEventArgs
    AGI.Parallel.ClientTaskProgressEventArgs
Namespace:  AGI.Parallel.Client
Assembly:  AGI.Parallel.Client (in AGI.Parallel.Client.dll) Version: 1.4.0.476 (1.4.0.476)
Syntax
public sealed class TaskProgressEventArgs : EventArgs

The TaskProgressEventArgs type exposes the following members.

Properties
  Name Description
Public property Description
Gets the progress data.
Public property Task
Gets the Task task whose progress was updated.
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 System.Collections.Generic;
using System.Diagnostics;
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 ProgressTask());

                // Subscribe to TaskProgressUpdated
#region SubsribeToTaskProgressUpdated
                job.TaskProgressUpdated += new EventHandler<TaskProgressEventArgs>(Job_TaskProgressUpdated);
#endregion

                job.Submit();
                job.WaitUntilDone();
            }

            /*
             * The output of the application should resemble:
             * 0 1
             * 20 B
             * 40 4
             * 60 D
             * 80 E
             */
        }

        private static void Job_TaskProgressUpdated(object sender, TaskProgressEventArgs e)
        {
            Console.WriteLine("{0} {1}", e.Description.Progress, e.Description.AdditionalInformation);
        }

        [Serializable]
        public class ProgressTask : Task
        {
            public override void Execute()
            {
                this.SetProgress(0, 1);
                System.Threading.Thread.Sleep(1000);
                this.SetProgress(20, "B");
                System.Threading.Thread.Sleep(1000);
#region CallSetProgress
                this.SetProgress(40, 4);
#endregion
                System.Threading.Thread.Sleep(1000);
                this.SetProgress(60, "D");
                System.Threading.Thread.Sleep(1000);
                this.SetProgress(80, "E");
                System.Threading.Thread.Sleep(1000);
            }
        }
    }
}
See Also

STK Scalability 1.4 API for .NET