public TResult Start<TResult>(Func<BrowsingSession, TResult> testScript) { var serializableDelegate = new SerializableDelegate<Func<BrowsingSession, TResult>>(testScript); FuncExecutionResult<TResult> result = _appDomainProxy.RunBrowsingSessionInAppDomain(serializableDelegate); CopyFields<object>(result.DelegateCalled.Delegate.Target, testScript.Target); return result.DelegateCallResult; }
public TResult Start <TResult>(Func <BrowsingSession, TResult> testScript) { SerializableDelegate <Func <BrowsingSession, TResult> > script = new SerializableDelegate <Func <BrowsingSession, TResult> >(testScript); FuncExecutionResult <TResult> funcExecutionResult = this._appDomainProxy.RunBrowsingSessionInAppDomain <TResult>(script); AppHost.CopyFields <object>(funcExecutionResult.DelegateCalled.Delegate.Target, testScript.Target); return(funcExecutionResult.DelegateCallResult); }
public FuncExecutionResult <TResult> RunBrowsingSessionInAppDomain2 <TResult>(SerializableDelegate <Func <BrowsingSession, TResult> > script) { // var browsingSession = new BrowsingSession(); var browsingSession = BrowsingSession.Instance; var local = script.Delegate(browsingSession); FuncExecutionResult <TResult> result = new FuncExecutionResult <TResult>(); result.DelegateCalled = script; result.DelegateCallResult = local; return(result); }