private async void InterceptAsync(object sender, RoutedEventArgs e) { IInterceptTest interceptTest = InterceptTestClass.GetProxy(); string ori = Helper.RandomString(20); string tra = await interceptTest.ToBase64Async(ori); Log.Info($"{ori} => {tra}"); }
public static IInterceptTest GetProxy() { InterceptTestClass testClass = new InterceptTestClass(); IInterceptTest interceptTest = MethodProxy.Intercept <IInterceptTest>(testClass, (sender, arg) => { Log.Info(arg); } , (sender, arg) => { Log.Info(arg); }); return(interceptTest); }