I have a c# program which calls the function, the callee
function, does some processes within a for loop. Now i want, as soon as the iterations are completed in the for loop, the caller
function should get notified about the same. I know i can write the Console.WriteLine
statement in the callee
function itself, but that's not what i want, because i might be using that function somewhere else as well, where i don't want to show any status to end user. Here's what i am currently doing:
Caller function.
public static void Main(string[] args)
{
Program p = new Program();
p.Callee();
// here i want to use the notification as a status for end user.
}
public void Callee()
{
for(int i=0; i<10; i++)
{
//here i need some mechanism which would notify the above caller function, once each iterations are completed. (whether success or failure).
}
}