#nullable disable
using System.Security.Cryptography;
namespace ConsoleIdeaTest
{
public enum Talent
{
天才,
聪明,
愚钝,
抱歉
}
public enum Attitude
{
刻苦,
一般,
吊儿郎当
}
class Program
{
static void Main(string[] args)
{
var family1 = new Family();
var family2 = new Family();
Func<Children> fun1 = new Func<Children>(family1.GiveBirth);
Func<Children> fun2 = new Func<Children>(family2.GiveBirth);
var school1 = new School();
var logger1 = new Logger();
Action<Student> log1 = new Action<Student>(logger1.Log);
Student stu1 = school1.GotoSchool(fun1,log1);
var logger2 = new Logger();
Action<Student> log2 = new Action<Student>(logger2.Log);
Student stu2 = school1.GotoSc
C# 委托,案例仿写:模板方法、回调方法
最新推荐文章于 2024-06-01 15:30:19 发布