예제 #1
0
        protected virtual void ProcessResponse(object sender, RunWorkerCompletedEventArgs e)
        {
            JsonResponseDictionary responseValues = e.Result as JsonResponseDictionary;

            if (responseValues != null)
            {
                string requestSuccessStatus = responseValues.get("Status");
                if (responseValues != null && requestSuccessStatus != null && requestSuccessStatus == "success")
                {
                    ProcessSuccessResponse(responseValues);
                    OnRequestSuceeded();
                }
                else
                {
                    ProcessErrorResponse(responseValues);
                    OnRequestFailed();
                }

                OnRequestComplete();
            }
            else
            {
                // Don't do anything, there was no respones.
            }
        }
		public override void ProcessSuccessResponse(JsonResponseDictionary responseValues)
		{
			string clientToken = responseValues.get("ClientToken");
			if (clientToken != null)
			{
				ApplicationSettings.Instance.SetClientToken(clientToken);
			}
		}
예제 #3
0
        private void saveResponse(string key, JsonResponseDictionary responseValues)
        {
            string value = responseValues.get(key);

            if (value != null)
            {
                ApplicationSettings.Instance.set(key, value);
            }
        }
예제 #4
0
        public override void ProcessSuccessResponse(JsonResponseDictionary responseValues)
        {
            string clientToken = responseValues.get("ClientToken");

            if (clientToken != null)
            {
                ApplicationSettings.Instance.set("ClientToken", clientToken);
            }
        }
예제 #5
0
        public virtual void ProcessErrorResponse(JsonResponseDictionary responseValues)
        {
            string errorMessage = responseValues.get("ErrorMessage");

            if (errorMessage != null)
            {
                Console.WriteLine(string.Format("Request Failed: {0}", errorMessage));
            }
            else
            {
                Console.WriteLine(string.Format("Request Failed: Unknown Reason"));
            }
        }
 private void saveResponse(string key, JsonResponseDictionary responseValues)
 {
     string value = responseValues.get(key);
     if (value != null)
     {
         ApplicationSettings.Instance.set(key, value);
     }
 }
 public virtual void ProcessErrorResponse(JsonResponseDictionary responseValues)
 {
     string errorMessage = responseValues.get("ErrorMessage");
     if (errorMessage != null)
     {
         Console.WriteLine(string.Format("Request Failed: {0}", errorMessage));
     }
     else
     {
         Console.WriteLine(string.Format("Request Failed: Unknown Reason"));
     }
 }