C# 使用委托实现回调功能
1.封装被调用库
public delegate string CallBack(string message); public int MyInterfance(CallBack cb) { return cb("张天才"); }
2.使用调用库
int ret = MyInterfance(callBack); public string callBack(string message) { return message; }
1.封装被调用库
public delegate string CallBack(string message); public int MyInterfance(CallBack cb) { return cb("张天才"); }
2.使用调用库
int ret = MyInterfance(callBack); public string callBack(string message) { return message; }