Exemplo n.º 1
0
        public void WritePriceAsync(PriceWebsiteDescription description, Action <IWebserviceResult> callback)
        {
            var asyncRequestInfo = new AsyncRequestInfo("WritePriceAsync", callback);

            Webservice.writePriceAsync(description.Valor, description.LastUpdated, description.Bid, description.Ask,
                                       asyncRequestInfo);
        }
Exemplo n.º 2
0
        public void ConnectAsync(Action <IWebserviceResult> callback)
        {
            var requestInfo = new AsyncRequestInfo("ConnectAsnyc", callback);

            WebserviceState = WebserviceWrapperState.Connecting;
            Webservice.LoginAsync(UserName, Password, requestInfo);
        }
Exemplo n.º 3
0
        public void DisconnectAsync(Action <IWebserviceResult> callback)
        {
            var requestInfo = new AsyncRequestInfo("DisconnectAsync", callback);

            WebserviceState = WebserviceWrapperState.Disconnecting;
            Webservice.LogoutAsync(requestInfo);
            WebserviceState = WebserviceWrapperState.Disconnected;
        }
Exemplo n.º 4
0
        private static void InvokeAsyncRequestCallback(AsyncRequestInfo asyncRequestInfo, object[] objects,
                                                       Exception exception)
        {
            if (exception != null)
            {
                throw new NotImplementedException("Unknown exception occurred.", exception);
            }

            if (asyncRequestInfo == null)
            {
                throw new NullReferenceException("asyncRequestInfo was null.");
            }

            asyncRequestInfo.Callback(new WebserviceResult(asyncRequestInfo, objects));
        }
Exemplo n.º 5
0
 private void InvokeAsyncRequestCallback(AsyncRequestInfo asyncRequestInfo, string result, Exception exception)
 {
     InvokeAsyncRequestCallback(asyncRequestInfo, new object[] { true, result }, exception);
 }