This code perfoms well.
I'm busy learning delegates in C# and merely want to know whether this is the correct use of Delegate and Callback method using delegate.
using System;
namespace DelegatesCallbackRealDemoApp
{
class Program
{
static void Main(string[] args)
{
Del handler = DelegateMethod;
DataProgression(1, handler);
Console.Read();
}
static void DelegateMethod(string message)
{
Console.WriteLine("Progression : " + message + " %");
DelegateMethodPause(1);
}
static void DelegateMethodPause(int sec)
{
System.Threading.Thread.Sleep(sec*1000);
}
static void DataProgression(int param1, Del callback)
{
for (int i = 0; i < 100; i++)
{
callback(param1.ToString());
param1++;
}
}
}
}