日期:2014-05-17 浏览次数:20865 次
class1 c1 = new class1() {
public void function1() {
System.Console.WriteLine("blabla.");
}
public String toString() { return "bla"; }
}
class interface1Adapter : interface1
{
private Action<object> f1;
private Func<imt, int> f2;
public interface1Adapter(Action<object> interfacefunction1, Func<imt, int> interfacefunc2)
{
f1 = interfacefunction1;
f2 = interfacefunc2;
}
public void interfacefunction1(object i2) { f1(i2); }
public int interfacefunc2(int p1) { return f2(p1); }
}
var c1 = new interface1Adapter(
x => { Console.WriteLine("interface2 run"); },
x => { Console.WriteLine("bla."); return 0; });
var c1 = new {
function1 = new Action(() => {
Console.WriteLine("blabla.");