Skip to content

Instantly share code, notes, and snippets.

@joeriks
Created June 13, 2011 08:12
Show Gist options
  • Save joeriks/1022454 to your computer and use it in GitHub Desktop.
Save joeriks/1022454 to your computer and use it in GitHub Desktop.
Javascript like send callback function in C#
static void Main(string[] args)
{
// sample Callback in C#
string message = "Done!";
startRunner(finished, message);
}
static public void finished(string message)
{
Console.Write(message);
}
static public void startRunner(Action<string> callback, string message)
{
// do something
Console.Write("Running");
callback(message);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment