Created
June 13, 2011 08:12
-
-
Save joeriks/1022454 to your computer and use it in GitHub Desktop.
Javascript like send callback function in C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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