Exemple #1
0
        void CallWebSvcCallAsync(drexModel.WebSvcMethod webSvcMethod)
        {
            utils.Logger.Instance.Log.Info("Start " + webSvcMethod.Name);

            _cancelToken = new drexProcess.WebSvcAsync.CancelToken();

            Thread thread = new Thread(() => {
                var call             = new drexProcess.WebSvcAsync.Operations.CallAsyncOp(webSvcMethod, _cancelToken, State.Instance.ConfigTimeout.Timeout, State.Instance.ConfigProxy, utils.Logger.Instance.Log);
                call.OnComplete     += call_OnComplete;
                call.OnWebException += call_OnWebException;
                call.OnException    += call_OnException;
                call.OnCancel       += call_OnCancel;
                call.OnTimeout      += call_OnTimeout;
                call.Start();
            });

            //the windows forms control must be updated by a thread with single threaded appartment property
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
        }
Exemple #2
0
        void CallWebSvcCallAsync(drexModel.WebSvcMethod webSvcMethod)
        {
            utils.Logger.Instance.Log.Info("Start " + webSvcMethod.Name);

            _cancelToken = new drexProcess.WebSvcAsync.CancelToken();

            Thread thread = new Thread(() => {

                var call = new drexProcess.WebSvcAsync.Operations.CallAsyncOp(webSvcMethod, _cancelToken, State.Instance.ConfigTimeout.Timeout, State.Instance.ConfigProxy, utils.Logger.Instance.Log);
                call.OnComplete += call_OnComplete;
                call.OnWebException += call_OnWebException;
                call.OnException += call_OnException;
                call.OnCancel += call_OnCancel;
                call.OnTimeout += call_OnTimeout;
                call.Start();

            });

            //the windows forms control must be updated by a thread with single threaded appartment property
            thread.SetApartmentState(ApartmentState.STA);
            thread.Start();
        }