internal static void handleError(JSONObjects.ErrorResponse error) { Debug.Assert(error.erro != null, "API.handleError invocado sem antes ser verificado se continha erro != null."); switch (error.erro) { case "Autorização": Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBox.Show("You don't have access to this information."); }); break; case "Autenticação": Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBox.Show("Previous session expired. Please login again."); }); break; default: Deployment.Current.Dispatcher.BeginInvoke(() => { MessageBox.Show(error.erro_msg); }); break; } }
/// <summary> /// Converts the given string to byte array of websocket protocol /// </summary> public void Send(Socket SendSocket,string SendData) { JSONObjects JS = new JSONObjects{ClientVersion = Application.ProductName,HandShake = true,} SendSocket.Send(Encoding.ASCII.GetBytes(SendData)); }