private void HandleUser(AuthenticatedUser p_user, BuddyCallbackParams p_params) { //check if everything went fine if (p_params.Exception != null || p_user == null) { //Display the buddy error if something went bad //Deployment.Current.Dispatcher.BeginInvoke(() => //{ // MessageBox.Show("Something went wrong " + ((BuddyServiceException)p_params.Exception).Error); //}); } else { //Store the user ServiceManager.User = p_user; //Debug.WriteLine("Success we got our user"); Deployment.Current.Dispatcher.BeginInvoke(() => { //jugador.añadirjugador(); //password = PasswordBox.Password; NavigationService.Navigate(new Uri("/Principal.xaml", UriKind.Relative)); }); } }
private void HandleCheckin(Boolean p_result, BuddyCallbackParams p_params) { Deployment.Current.Dispatcher.BeginInvoke(() => { if (p_result && p_params.Exception == null) { MessageBox.Show("Success"); } else { MessageBox.Show("An error occured " + (p_params.Exception as BuddyServiceException).Error); } }); }
public static void HandleAsyncResults <ResultType>(ResultType resultType, BuddyCallbackParams callbackParams, Action action, string errorMessage = null) where ResultType : class { if (resultType == null || callbackParams.Exception != null) { if (!string.IsNullOrEmpty(errorMessage)) { Utilities.CrossThreadMessageBox(errorMessage); } } else { action(); } }
private void HandleCheckins(List <CheckInLocation> arg1, BuddyCallbackParams arg2) { // marker = new MapLayer(); MapLayer layer = new MapLayer(); foreach (CheckInLocation x in arg1) { MapOverlay overlay = new MapOverlay { GeoCoordinate = new GeoCoordinate(x.Latitude, x.Longitude), Content = new Ellipse { Fill = new SolidColorBrush(Colors.Red), Width = 10, Height = 10 } }; layer.Add(overlay); } map.Layers.Add(layer); }