public static async Task DeletePost(Post post) { try { var response = await ClientBackend.client.DeleteAsync(ClientBackend.api_domain + "/posts/" + post.ID); string responseContent = await response.Content.ReadAsStringAsync(); ServerFeedback serverFeedback = JsonConvert.DeserializeObject <ServerFeedback>(responseContent); if (serverFeedback.Status.Equals("success", StringComparison.OrdinalIgnoreCase)) { throw new DataFormatException(); } } catch (DataFormatException) { throw; } catch (System.Exception) { throw new UnknownException(); } }
public static async Task UpdatePost(Post post) { try { string json = JsonConvert.SerializeObject(post); var response = await ClientBackend.client.PutAsync((ClientBackend.api_domain + "/posts/" + post.ID) , new StringContent(json, Encoding.UTF8, "application/json")); string responseContent = await response.Content.ReadAsStringAsync(); ServerFeedback serverFeedback = JsonConvert.DeserializeObject <ServerFeedback>(responseContent); if (!serverFeedback.Status.Equals("success", StringComparison.OrdinalIgnoreCase)) { throw new DataFormatException(); } } catch (DataFormatException) { throw; } catch (System.Exception) { throw new UnknownException(); } }
public static async Task RegisterUser(UserPersonalInfo userPersonalInfo) { try { string json = JsonConvert.SerializeObject(userPersonalInfo); var response = await ClientBackend.client.PostAsync((ClientBackend.api_domain + "/user"), new StringContent(json, Encoding.UTF8, "application/json")); string responseContent = await response.Content.ReadAsStringAsync(); ServerFeedback serverFeedback = JsonConvert.DeserializeObject <ServerFeedback>(responseContent); if (serverFeedback.Status.Equals("success", StringComparison.OrdinalIgnoreCase)) { ClientBackend.StroreCredentials(userPersonalInfo.Login, userPersonalInfo.Password); } else { throw new DataFormatException(); } } catch (DataFormatException) { throw; } catch (ArgumentNullException) { throw; } catch (HttpRequestException) { throw; } catch (System.Exception) { throw new UnknownException(); } }
public static void raiseArmsWideEvent(ServerFeedback feedback) { armsWideEvent(null, new LongFeedback(feedback.feedbackMessage, feedback.display)); }
public static void raisePostureEvent(ServerFeedback feedback) { postureEvent(null, new InstantFeedback(feedback.feedbackMessage)); }
public static void raiseHandsJoinedEvent(ServerFeedback feedback) { handsJoinedEvent(null, new InstantFeedback(feedback.feedbackMessage)); }
public static void raiseMouthEvent(ServerFeedback feedback) { mouthEvent(null, new LongFeedback(feedback.feedbackMessage, feedback.display)); }
public static void raiseEmotionEvent(ServerFeedback feedback) { emoEvent(null, new LongFeedback(feedback.feedbackMessage, feedback.display)); }
public static void raisEpicnessEvent(ServerFeedback feedback) { epicnessEvent(null, new InstantFeedback(feedback.feedbackMessage)); }
/// <summary> /// Raise the event to display a new looking direction feedback /// </summary> public static void raiseLookEvent(ServerFeedback feedback) { lookEvent(null, new InstantFeedback(feedback.feedbackMessage)); }
public static void raiseEnthusiasmEvent(ServerFeedback feedback) { enthusiasmEvent(null, new InstantFeedback(feedback.feedbackMessage)); }
public static void raiseAgitationEvent(ServerFeedback feedback) { agitationEvent(null, new InstantFeedback(feedback.feedbackMessage)); }
public static void raiseArmsCrossedEvent(ServerFeedback feedback) { handsInPocketEvent(null, new InstantFeedback(feedback.feedbackMessage)); }
public static void raiseReflexEvent(ServerFeedback feedback) { reflexEvent(null, new LongFeedback(feedback.feedbackMessage, feedback.display)); }
public static void raisePupilREvent(ServerFeedback feedback) { pupilREvent(null, new LongFeedback(feedback.feedbackMessage, feedback.display)); }