Created
September 12, 2018 21:22
-
-
Save PhiHuyHoang/0eb3c4224ebef592d70ff61175c0de9f to your computer and use it in GitHub Desktop.
method constructor function example 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 ConsoleLog(string s) | |
{ | |
Console.WriteLine($"[CONSOLE] {s}"); | |
} | |
static void Main(string[] args) | |
{ | |
/// section 1 /// | |
Logger log = new Logger(); | |
log.AddLogMethod(ConsoleLog); | |
log.AddLogMethod(delegate (string s) { Console.WriteLine($"[ANON] {s}"); }); | |
log.AddLogMethod(s => Console.WriteLine($"[LAMDA] {s}")); | |
log.LogThis("Hello, delegates"); Thread.Sleep(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment