Calling my function I passed through as a parameter
I have a function:
public void Callback()
{
// Does some stuff
}
I want to pass that in to another function, which then passes it to
another function, which then executes the function... I have this so far:
public void StartApp() // entry point
{
StartMyAwesomeAsyncPostRequest( Callback );
}
public void StartMyAwesomeAsyncPostRequest( Delegate callback )
{
// Work out some stuff and start a post request
TheActualAsyncPostRequest( callback );
}
public void TheActualAsyncPostRequest( Delegate callback )
{
// Do some jazz then run the delegated function
callback();
}
I have looked through a few other examples but coming from a PHP and
javascript background, I'm struggling with the explanations, can you
perhaps give me an example or explanation specific to my request? Thanks
in advance!
No comments:
Post a Comment