-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
34c2f71
commit 2c42b4b
Showing
153 changed files
with
2,865 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// See https://aka.ms/new-console-template for more information | ||
Console.WriteLine("Hello, World!"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
log = info; | ||
log("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
log = Info; | ||
log("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
log = Info; | ||
log("Hello"); | ||
log.Invoke("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
// log = Info; | ||
log("Hello"); | ||
log.Invoke("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
log = Info; | ||
log("Hello"); | ||
log.Invoke("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Warning(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
log = Info; | ||
log("Hello"); | ||
log.Invoke("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Warning(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
log = Info; | ||
log("Hello"); | ||
log.Invoke("Hello"); | ||
|
||
log = Warning; | ||
log("warning"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Warning(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
// ShowLog log = null; | ||
// log = Info; | ||
// log("Hello"); | ||
// log.Invoke("Hello"); | ||
|
||
// log = Warning; | ||
// log("warning"); | ||
|
||
log += Info; | ||
log += Warning; | ||
log?.Invoke("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Warning(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
// log = Info; | ||
// log("Hello"); | ||
// log.Invoke("Hello"); | ||
|
||
// log = Warning; | ||
// log("warning"); | ||
|
||
log += Info; | ||
log += Warning; | ||
log?.Invoke("Hello"); | ||
|
||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Warning(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
// log = Info; | ||
// log("Hello"); | ||
// log.Invoke("Hello"); | ||
|
||
// log = Warning; | ||
// log("warning"); | ||
|
||
log += Info; | ||
log += Warning; | ||
log?.Invoke("Hello"); | ||
|
||
|
||
Action action; //delegate void Kieu(); | ||
Action<string> action1; //delegate void Kieu(string s); | ||
Action<string, int> action2; //delegate void Kieu(string s, int i); | ||
|
||
action2 = Warning; | ||
action2 += Info; | ||
|
||
action2?.Invoke("Hello"); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
namespace CS_Delegate | ||
{ | ||
public delegate void ShowLog(string message); | ||
|
||
class Program | ||
{ | ||
|
||
static void Info(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Green; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Warning(string s) | ||
{ | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine("Info: {0}", s); | ||
Console.ResetColor(); | ||
} | ||
static void Main(string[] args) | ||
{ | ||
|
||
ShowLog log = null; | ||
// log = Info; | ||
// log("Hello"); | ||
// log.Invoke("Hello"); | ||
|
||
// log = Warning; | ||
// log("warning"); | ||
|
||
log += Info; | ||
log += Warning; | ||
log?.Invoke("Hello"); | ||
|
||
|
||
Action action; //delegate void Kieu(); | ||
Action<string> action1; //delegate void Kieu(string s); | ||
Action<string, int> action2; //delegate void Kieu(string s, int i); | ||
|
||
action1 = Warning; | ||
action1 += Info; | ||
|
||
action2?.Invoke("Hello"); | ||
} | ||
} | ||
} |
Oops, something went wrong.