I have a function that needs to be executed only when a callback is received from asynchronous function.
Like
I call asynchronous function Stop()
and soon after that I call asynchronous function Start()
.
The Issue before Stop CallBack is received Start()
is called and thus I am getting issues. Also I can not separate the calling of two functions Like I can not do this.:
public void SomeFunction()
{
Stop();
}
public void Stop_CallBack(eventargs e)
{
Start();
}
I have to do this:
public void SomeFunction()
{
Stop();
//Do something;
Start();
}
but before I receive Stop call back my start() function is executed thus creating the problems for me.
Can anyone help me out how can I solve this issue.