use style
This commit is contained in:
26
PacticeSolution/AnonymousMethod/Program.cs
Normal file
26
PacticeSolution/AnonymousMethod/Program.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
namespace AnonymousMethod
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
private delegate void TestDelegate();
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
DoTest();
|
||||
}
|
||||
|
||||
private static void DoTest()
|
||||
{
|
||||
TestDelegate t = delegate() {
|
||||
Console.WriteLine("Anonymous method by delegate");
|
||||
};
|
||||
|
||||
t += () =>
|
||||
{
|
||||
Console.WriteLine("Anonymous method by lambda");
|
||||
};
|
||||
|
||||
t();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user