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); } }
private void saveResponse(string key, JsonResponseDictionary responseValues) { string value = responseValues.get(key); if (value != null) { ApplicationSettings.Instance.set(key, value); } }
public override void ProcessSuccessResponse(JsonResponseDictionary responseValues) { string clientToken = responseValues.get("ClientToken"); if (clientToken != null) { ApplicationSettings.Instance.set("ClientToken", clientToken); } }
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")); } }