Ejemplo n.º 1
0
        private void ExecuteRequest()
        {
            if (_Request == null)
            {
                _MainLog.LogWarning("Create a request before executing!");
                return;
            }

            if (rbExecInprocess.Checked)
            {
                ThreadPool.QueueUserWorkItem(BackgroundWorker, _Request);
                _Request = null;
            }
            else if (rbExecAssignToWorker.Checked)
            {
                RequestBase.DispatchToWorker(_ClientRef.Target, _Request, txtWorkerComputer.Text, txtWorkerInstance.Text);
                _Request = null;
            }
            else if (rbExecSendToManager.Checked)
            {
                RequestBase.DispatchToManager(_ClientRef.Target, _Request);
                _Request = null;
            }
            else
            {
                _MainLog.LogWarning("No request handling option chosen!");
            }
        }
Ejemplo n.º 2
0
 private void BackgroundWorker(object state)
 {
     try
     {
         RequestBase request = (RequestBase)state;
         RequestBase.DispatchToWorker(_ClientRef.Target, request, Environment.MachineName, "Internal");
         int result = RequestHandler.HandleRequest(_MainLog, _ClientRef.Target, new Guid(request.RequestId), "Internal");
         _MainLog.LogDebug("HandleRequest returned: {0}", result);
     }
     catch (Exception e)
     {
         _MainLog.Log(e);
     }
 }