コード例 #1
0
 public CachedMethodExecutor(IMethodExecutor methodExecutor, Type staticClass, Type target, List <Type> argumentTypes)
 {
     _methodExecutor = methodExecutor;
     _staticClass    = staticClass;
     _target         = target;
     _argumentTypes  = argumentTypes;
 }
コード例 #2
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor, ISandbox sandbox)
 {
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
     _sandbox        = sandbox;
     InitializeConverter();
 }
コード例 #3
0
 protected HookExecutionProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper)
 {
     _messageCollectorType = assemblyLoader.GetLibType(LibType.MessageCollector);
     MethodExecutor        = methodExecutor;
     _reflectionWrapper    = reflectionWrapper;
     Strategy = new HooksStrategy();
 }
コード例 #4
0
 public static TDelegate Wrap <TDelegate>(this IMethodExecutor executor, object target)
 => (TDelegate)_caches.GetOrAdd(executor, exec =>
 {
     var method     = exec.MethodInfo;
     var parameters = exec.MethodParameters.Select(p => Expression.Parameter(p.ParameterType)).ToArray();
     var invoke     = Expression.Call(Expression.Constant(target), method, parameters);
     var runner     = method.ReturnType == typeof(void) ? (Expression)Expression.Block(invoke) : Expression.Convert(invoke, method.ReturnType);
     return(Expression.Lambda <TDelegate>(runner, parameters).Compile());
 });
コード例 #5
0
        public RpcBindingHost(IConnection <TMarshal> connection, IPlatformBinder <TMarshal> parameterBinder, IScheduler baseScheduler)
        {
            this.connection   = connection;
            bindingRepository = new BindingRepository(new IntIdGenerator());

            if (baseScheduler is IDisposable disposable)
            {
                disposables.Add(disposable);
            }

            // ReSharper disable once InvokeAsExtensionMethod
            var baseMessages = Observable.ObserveOn(connection, baseScheduler);

            callbackExecutor = new CallbackExecutor <TMarshal>(new IntIdGenerator(),
                                                               connection,
                                                               baseMessages.Select(m => m.CallbackResult)
                                                               .Where(m => m != null));
            var callbackFactory = new CallbackFactory <TMarshal>(callbackExecutor);
            var binder          = new ObjectBinderBuilder <TMarshal>().Use(typeof(CallbackBinder <TMarshal>), callbackFactory)
                                  .Use(typeof(OutgoingValueBinder <TMarshal>), bindingRepository)
                                  .Use(typeof(PlatformBinder <TMarshal>), parameterBinder).Build();

            methodExecutor   = new MethodExecutor <TMarshal>(bindingRepository.Objects, binder);
            propertyExecutor = new PropertyExecutor <TMarshal>(bindingRepository.Objects, binder);

            disposables.Add(Observable.ObserveOn((callbackExecutor as IObservable <DeleteCallback>), baseScheduler)
                            .Subscribe(OnDeleteCallback));
            disposables.Add(Observable.ObserveOn((callbackExecutor as IObservable <CallbackExecution <TMarshal> >), baseScheduler)
                            .Subscribe(OnCallbackExecution));

            // ReSharper disable once InvokeAsExtensionMethod

            disposables.Add(baseMessages
                            .Select(m => m.MethodExecution)
                            .Where(m => m != null)
                            .Subscribe(OnMethodExecution));
            disposables.Add(baseMessages
                            .Select(m => m.PropertyGet)
                            .Where(m => m != null)
                            .Subscribe(OnPropertyGetExecution));
            disposables.Add(baseMessages
                            .Select(m => m.PropertySet)
                            .Where(m => m != null)
                            .Subscribe(OnPropertySetExecution));
            disposables.Add(baseMessages
                            .Select(m => m.DynamicObjectRequest)
                            .Where(m => m != null)
                            .Subscribe(OnDyanmicObjectRequest));

            disposables.Add(connection);
        }
コード例 #6
0
 protected TaggedHooksFirstExecutionProcessor(IMethodExecutor methodExecutor)
     : base(methodExecutor)
 {
     Strategy = new TaggedHooksFirstStrategy();
 }
コード例 #7
0
 public StepExecutionEndingProcessor(IMethodExecutor methodExecutor)
     : base(methodExecutor)
 {
 }
コード例 #8
0
 protected TaggedHooksFirstExecutionProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor)
     : base(hookRegistry, methodExecutor)
 {
     Strategy = new TaggedHooksFirstStrategy();
 }
コード例 #9
0
 public ScenarioExecutionEndingProcessor(IMethodExecutor methodExecutor, ISandbox sandbox)
     : base(methodExecutor)
 {
     _sandbox = sandbox;
 }
コード例 #10
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor, ITableFormatter tableFormatter)
 {
     _tableFormatter = tableFormatter;
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
 }
コード例 #11
0
 public TestUntaggedHooksFirstExecutionProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper)
     : base(methodExecutor, assemblyLoader, reflectionWrapper)
 {
 }
コード例 #12
0
 public SpecExecutionStartingProcessor(IMethodExecutor methodExecutor, ISandbox sandbox)
     : base(methodExecutor)
 {
     _sandbox = sandbox;
 }
コード例 #13
0
 public ExecutionStartingProcessor(IMethodExecutor methodExecutor) : base(methodExecutor)
 {
 }
コード例 #14
0
 protected UntaggedHooksFirstExecutionProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper)
     : base(methodExecutor, assemblyLoader, reflectionWrapper)
 {
     Strategy = new UntaggedHooksFirstStrategy();
 }
コード例 #15
0
 public ScenarioExecutionEndingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor, ISandbox sandbox)
     : base(hookRegistry, methodExecutor)
 {
     _sandbox = sandbox;
 }
コード例 #16
0
 protected HookExecutionProcessor(IMethodExecutor methodExecutor)
 {
     MethodExecutor = methodExecutor;
     Strategy       = new HooksStrategy();
 }
コード例 #17
0
 public SpecExecutionStartingProcessor(IMethodExecutor methodExecutor, ISandbox sandbox, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper)
     : base(methodExecutor, assemblyLoader, reflectionWrapper)
 {
     _sandbox = sandbox;
 }
コード例 #18
0
 public StepExecutionStartingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor)
     : base(hookRegistry, methodExecutor)
 {
 }
コード例 #19
0
ファイル: MethodExecutor.cs プロジェクト: dcvsling/Core.Lib
 public static Task <object> ExecuteAsync(this IMethodExecutor executor, object target, params object[] args)
 => executor.Execute(target, args).CreateResult();
コード例 #20
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor)
 {
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
     InitializeConverter();
 }
コード例 #21
0
 protected HookExecutionProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor)
 {
     MethodExecutor = methodExecutor;
     Hooks          = hookRegistry;
     Strategy       = new HooksStrategy();
 }
コード例 #22
0
 public StepExecutionEndingProcessor(IMethodExecutor methodExecutor, IAssemblyLoader assemblyLoader, IReflectionWrapper reflectionWrapper)
     : base(methodExecutor, assemblyLoader, reflectionWrapper)
 {
 }
コード例 #23
0
 public SpecExecutionEndingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor)
     : base(hookRegistry, methodExecutor)
 {
 }
コード例 #24
0
 public SpecExecutionStartingProcessor(IHookRegistry hookRegistry, IMethodExecutor methodExecutor, ISandbox sandbox)
     : base(hookRegistry, methodExecutor)
 {
     _sandbox = sandbox;
 }
コード例 #25
0
 public ExecuteStepProcessor(IStepRegistry stepRegistry, IMethodExecutor methodExecutor)
 {
     _stepRegistry   = stepRegistry;
     _methodExecutor = methodExecutor;
 }