コード例 #1
0
ファイル: AppHost.cs プロジェクト: inchbuie/Mvc5TestBed
 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;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }