Skip to content

Commit

Permalink
homework
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanglong2311 committed Mar 24, 2022
1 parent 34c2f71 commit 2c42b4b
Show file tree
Hide file tree
Showing 153 changed files with 2,865 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118094900.cs
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!");
21 changes: 21 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095505.cs
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;

}
}
}
23 changes: 23 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095548.cs
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");

}
}
}
23 changes: 23 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095617.cs
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");

}
}
}
24 changes: 24 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095648.cs
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");

}
}
}
24 changes: 24 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095744.cs
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");

}
}
}
24 changes: 24 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095749.cs
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");

}
}
}
30 changes: 30 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095938.cs
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");

}
}
}
33 changes: 33 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118095957.cs
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");

}
}
}
37 changes: 37 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118100131.cs
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");

}
}
}
37 changes: 37 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118100138.cs
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");

}
}
}
46 changes: 46 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118100611.cs
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");
}
}
}
46 changes: 46 additions & 0 deletions Week9/CS_Delegate/.history/Program_20220118100627.cs
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");
}
}
}
Loading

0 comments on commit 2c42b4b

Please sign in to comment.