public static SurrogateForIPedantic Convert(IPedantic value) { if (value == null) { return(null); } return(new SurrogateForIPedantic { Target = ((PedanticRef)value).Target }); }
IEnumerator ProcessPedantic(IPedantic pedantic) { WriteLine("*** Pedantic ***"); var t1 = pedantic.TestCall(); yield return(t1.WaitHandle); ShowResult(t1, "TestCall"); var t2 = pedantic.TestOptional(10); yield return(t2.WaitHandle); ShowResult(t2, "TestOptional(10)"); var t3 = pedantic.TestTuple(Tuple.Create(1, "one")); yield return(t3.WaitHandle); ShowResult(t3, "TestTuple"); var t4 = pedantic.TestParams(1, 2, 3); yield return(t4.WaitHandle); ShowResult(t4, "TestParams"); var t5 = pedantic.TestPassClass(new TestParam { Name = "Mouse", Price = 10 }); yield return(t5.WaitHandle); ShowResult(t5, "TestPassClass"); var t6 = pedantic.TestReturnClass(10, 5); yield return(t6.WaitHandle); ShowResult(t6, "TestReturnClass"); WriteLine(""); }
public static SurrogateForIPedantic Convert(IPedantic value) { if (value == null) return null; return new SurrogateForIPedantic { Target = ((PedanticRef)value).Target }; }