예제 #1
0
        public AsyncResult(DelegateRunner runner, object asyncDelegate, AsyncCallback callback, object param)
        {
            this.runner        = runner;
            this.asyncDelegate = asyncDelegate;
            this.callback      = callback;
            this.param         = param;

            runner.AsyncResult          = this;
            runner.OnEnd                = callback;
            this.task                   = ThreadPools.AsyncPool.submit(runner);
            this.CompletedSynchronously = this.task.isDone();
        }
예제 #2
0
        public void TestPatientValidation(int tries, bool parallel, string patientId)
        {
            var patient    = GetSomePatient(patientId);
            var itemsToRun = new List <DelegateParameters>();

            for (var i = 0; i < tries; i++)
            {
                var parameters = new List <object> {
                    patient
                };
                Func <Resource, OperationOutcome> func = DoValidation;
                itemsToRun.Add(new DelegateParameters
                {
                    Delegate   = func,
                    Parameters = parameters.ToArray()
                });
            }
            DelegateRunner.Run(itemsToRun, parallel);
        }
예제 #3
0
        private static void InvokeAsync(this Delegate target, params object[] args)
        {
            var runner = new DelegateRunner(target, args);

            runner.Execute();
        }
        protected virtual void InvokeSpecificationField()
        {
            var runner = new DelegateRunner(_it);

            runner.Execute();
        }