public void OnException(App42Exception exception)
 {
     DISPATCHER.ExecuteAsync(delegate()
     {
         StorageResponseTBL.Text = "Exception is : " + exception;
     });
 }
 private void GetTopNRankersCallback(object response, bool IsException)
 {
     if (IsException)
     {
         App42Exception exception = (App42Exception)response;
         MessageBox.Show(exception.GetMessage());
     }
     else
     {
         com.shephertz.app42.paas.sdk.windows.game.Game game = (com.shephertz.app42.paas.sdk.windows.game.Game)response;
         if (game.IsResponseSuccess())
         {
             for (int i = 0; i < game.GetScoreList().Count; i++)
             {
                 ScoreListItem item = new ScoreListItem();
                 item.Rank     = (i + 1).ToString();
                 item.Score    = game.GetScoreList()[i].GetValue().ToString();
                 item.UserName = game.GetScoreList()[i].GetUserName();
                 _scorelist.Add(item);
             }
             lbxGlobalScore.ItemsSource = _scorelist;
         }
         else
         {
             // lbxGlobalScoremessageTB.Text = "Error,Please try again later";
         }
     }
 }
Exemplo n.º 3
0
        public void OnException(Exception e)
        {
            App42Exception exception    = (App42Exception)e;
            int            appErrorCode = exception.GetAppErrorCode();

            if (appErrorCode == 2001)
            {
            }
            App42Log.Console("Exception : " + e);
        }
Exemplo n.º 4
0
        public void OnException(App42Exception exception)
        {
            Deployment.Current.Dispatcher.BeginInvoke(() => {
                switch (pivot.SelectedIndex)
                {
                case 0:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        UserOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }

                    break;

                case 1:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        StorageOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }
                    break;

                case 2:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        gameOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }
                    break;

                case 3:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        uploadOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }
                    break;
                }
            });
        }
Exemplo n.º 5
0
 public void OnException(App42Exception exception)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         if (exception.GetAppErrorCode() == 1401)
         {
             MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
         }
         else
         {
             MessageBox.Show(exception.Message);
         }
     });
 }
Exemplo n.º 6
0
            public void OnException(App42Exception exception)
            {
                int appErrorCode  = exception.GetAppErrorCode();
                int httpErrorCode = exception.GetHttpErrorCode();

                string errorMsg = string.Empty;

                switch (appErrorCode)
                {
                case 4600:
                    errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
                    break;

                case 4601:
                    errorMsg = "USAGE ERROR: Friend request already sent for this user. Please add a different friend.";
                    break;

                case 4602:
                    errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
                    break;

                case 4603:
                    errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
                    break;

                case 4604:
                    // User has no friends yet so the App42 API's return this error code. This will always happen for new users
                    //	and user's with empty friends lists but it is not really an error
                    AppServices.operationSuccessful = true;
                    AppServices.app42LoadedFriends  = true;
                    return;

                case 4613:
                    errorMsg = "USAGE ERROR: The entered username is already on your friends list. Please add a different friend.";
                    break;

                default:
                    errorMsg = "ERROR: An error has occured. Please check your network connection and username entry and try again.";
                    break;
                }

                AppServices.operationSuccessful = false;
                AppServices.errorMessage        = errorMsg;
                AppServices.app42LoadedFriends  = true;

                //_friendsModel._page.SetProgressIndicatorAsync(false, string.Empty);
                //_friendsModel._page.EnableInputAsync();
                //_friendsModel._page.PrintMessage(errorMsg);
            }
        public void OnException(App42Exception exception)
        {
            Deployment.Current.Dispatcher.BeginInvoke(() => {
            switch (pivot.SelectedIndex)
            {
                case 0:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        UserOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }

                    break;
                case 1:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        StorageOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }
                    break;
                case 2:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        gameOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }
                    break;
                case 3:
                    if (exception.GetAppErrorCode() == 1401)
                    {
                        MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                    }
                    else
                    {
                        uploadOutput.Text = "Exception Caught successfully:-" + exception.Message;
                    }
                    break;
            }
            });
        }
Exemplo n.º 8
0
    public string get_error_code(App42Exception e)
    {
        string error;

        try
        {
            error = (string)error_codes[e.GetAppErrorCode().ToString()];
        }
        catch
        {
            return e.Message;
        }

        return error;
    }
Exemplo n.º 9
0
        public void OnException(App42Exception exception)
        {
            Deployment.Current.Dispatcher.BeginInvoke(() =>
            {
                if (exception.GetAppErrorCode() == 1401)
                {
                    MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
                }
                else
                {
                    MessageBox.Show(exception.Message);

                }
            });
        }
Exemplo n.º 10
0
 public void OnException(App42Exception exception)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         if (exception.GetAppErrorCode() == 1401)
         {
             MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
         }
         else
         {
             MessageBox.Show(exception.Message);
             //UserOutput.Text = string.Empty;
             //UserOutput.Text = "Exception Caught successfully:-" + exception.Message;
         }
     });
 }
Exemplo n.º 11
0
 public void OnException(App42Exception exception)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         if (exception.GetAppErrorCode() == 1401)
         {
             MessageBox.Show("Please Enter valid api key and secret key getting from AppHQ Management Console!!!", "App42 Security Exception", MessageBoxButton.OK);
         }
         else
         {
             MessageBox.Show(exception.Message);
             //UserOutput.Text = string.Empty;
             //UserOutput.Text = "Exception Caught successfully:-" + exception.Message;
         }
     });
 }
Exemplo n.º 12
0
            public void OnException(App42Exception exception)
            {
                int appErrorCode  = exception.GetAppErrorCode();
                int httpErrorCode = exception.GetHttpErrorCode();

                string errorMsg = string.Empty;

                switch (appErrorCode)
                {
                case 1400:
                    errorMsg = "Network Error: The request parameters are invalid. Please check your network connection and try again.";
                    break;

                case 1401:
                    errorMsg = "Unauthorized Access Error: The client is not authorized to add a user.";
                    break;

                case 1500:
                    errorMsg = "Internal Server Error: Please try again.";
                    break;

                case 2200:
                    errorMsg = "Service Error: User by the given name does not exist.";
                    break;

                case 2201:
                    errorMsg = "Service Error: Session for user does not exist.";
                    break;

                case 2202:
                    errorMsg = "Service Error: Session with the given id does not exist.";
                    break;

                case 2203:
                    errorMsg = "Service Error: Bad request. The session for the given ID is already invalidated.";
                    break;

                default:
                    errorMsg = "Unknown Error: An unknown error has occured. Please check your network connection and try again.";
                    break;
                }

                AppServices.errorMessage        = errorMsg;
                AppServices.operationSuccessful = false;
                AppServices.app42LoggedIn       = true;
            }
 // callback when server return an Exception on storage query .
 void App42Callback.OnException(App42Exception exception)
 {
     if (exception.GetAppErrorCode().Equals(2601))
     {
         currentPage.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show("No one shared anything for you.");
         });
     }
     else
     {
         currentPage.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show(exception.Message.ToString());
         });
     }
    
 }
Exemplo n.º 14
0
            public void OnException(App42Exception exception)
            {
                int appErrorCode  = exception.GetAppErrorCode();
                int httpErrorCode = exception.GetHttpErrorCode();

                string errorMsg = string.Empty;

                switch (appErrorCode)
                {
                case 0:
                    errorMsg = "ENTRY ERROR: Username cannot be blank. Please try again.";
                    break;

                case 4600:
                    errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
                    break;

                case 4601:
                    errorMsg = "USAGE ERROR: Friend request already sent for this user. Please add a different friend.";
                    break;

                case 4602:
                    errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
                    break;

                case 4603:
                    errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
                    break;

                case 4613:
                    errorMsg = "USAGE ERROR: The entered username is already on your friends list. Please add a different friend.";
                    break;

                default:
                    errorMsg = "ERROR: An error has occured. Please check your network connection and username entry and try again.";
                    break;
                }

                AppServices.operationSuccessful = false;
                AppServices.errorMessage        = errorMsg;
                AppServices.operationComplete   = true;
            }
Exemplo n.º 15
0
        // This will be called if there is an error or if there is no session. Error handling is currently not implemented we just assume
        //	that there is no session
        public void OnException(App42Exception exception)
        {
            int appErrorCode  = exception.GetAppErrorCode();
            int httpErrorCode = exception.GetHttpErrorCode();

            if (appErrorCode == 2202)
            {
                // Handle here for Not Found (Session with the id '@sessionId' does not exist.)
                AppServices.operationSuccessful = false;
                AppServices.errorMessage        = "INPUT ERROR: User does not exist. Cannot check for session.";
                AppServices.isFriendOnline      = true;
                AppServices.operationComplete   = true;
                return;
            }
            // This is called when the user is simply offline. So it is not really an error.
            else if (appErrorCode == 2203)
            {
                // Handle here for Bad Request (The request parameters are invalid. Session with the Id '@sessionId' is already invalidated.)
                AppServices.isFriendOnline = false;
            }
            else if (appErrorCode == 1401)
            {
                // handle here for Client is not authorized
                AppServices.operationSuccessful = false;
                AppServices.errorMessage        = "NETWORK ERROR: Client not authorized to check for session.";
                AppServices.isFriendOnline      = true;
                AppServices.operationComplete   = true;
                return;
            }
            else if (appErrorCode == 1500)
            {
                // handle here for Internal Server Error
                AppServices.operationSuccessful = false;
                AppServices.errorMessage        = "NETWORK ERROR: An internal server error has occured while attempting check for a session.";
                AppServices.isFriendOnline      = true;
                AppServices.operationComplete   = true;
                return;
            }
            AppServices.operationSuccessful = true;
            AppServices.operationComplete   = true;
        }
 // Call when storage has no document for share or receive image.
 void App42Callback.OnException(App42Exception exception)
 {
     if (exception.GetAppErrorCode().Equals(2601))
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show("You did not shared anything.");
         });
     }
     else
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show(exception.Message.ToString());
         });
     }
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         indicator.IsVisible = false;
     });
 }
Exemplo n.º 17
0
            public void OnException(App42Exception exception)
            {
                int appErrorCode  = exception.GetAppErrorCode();
                int httpErrorCode = exception.GetHttpErrorCode();

                if (appErrorCode == 4601)
                {
                    //Handle here for Bad Request (The request parameters are invalid. Request already sent for user 'Nick')
                }
                else if (appErrorCode == 1401)
                {
                    // handle here for Client is not authorized
                }
                else if (appErrorCode == 1500)
                {
                    // handle here for Internal Server Error
                }

                AppServices.operationSuccessful = false;
                AppServices.operationComplete   = true;
            }
Exemplo n.º 18
0
        public void OnException(App42Exception exception)
        {
            App42Exception ex            = (App42Exception)exception;
            int            appErrorCode  = exception.GetAppErrorCode();
            int            httpErrorCode = exception.GetHttpErrorCode();

            // Attempt to get the mutex to update the number of friends sessions processed
            AppServices.friendCountMutex.WaitOne();
            AppServices.numFriendsProcessed++;

            // If all friends have been processed we signify the main thread we are done
            if (AppServices.numFriendsProcessed == AppServices.friendsData.friendsList.Count)
            {
                AppServices.friendCountMutex.ReleaseMutex();
                AppServices.operationSuccessful = true;
                AppServices.app42LoadedFriends  = true;
                return;
            }

            AppServices.friendCountMutex.ReleaseMutex();
        }
Exemplo n.º 19
0
            public void OnException(App42Exception exception)
            {
                int appErrorCode  = exception.GetAppErrorCode();
                int httpErrorCode = exception.GetHttpErrorCode();

                string errorMsg = "";

                switch (appErrorCode)
                {
                case 2001:
                    errorMsg = "User Entry Error: Username already exists. Please try a different username.";
                    break;

                case 2005:
                    errorMsg = "User Entry Error: User with that email already exists. Please use a different email.";
                    break;

                case 1400:
                    errorMsg = "Network Error: The request parameters are invalid. Please check your network connection and try again.";
                    break;

                case 1401:
                    errorMsg = "Unauthorized Access Error: The client is not authorized to add a user.";
                    break;

                case 1500:
                    errorMsg = "Internal Server Error: Please try again.";
                    break;

                default:
                    errorMsg = "Unknown Error: An unknown error has occured. Please check your network connection and try again.";
                    break;
                }

                AppServices.operationSuccessful = false;
                AppServices.errorMessage        = errorMsg;
                AppServices.operationComplete   = true;
            }
Exemplo n.º 20
0
            public void OnException(App42Exception exception)
            {
                int appErrorCode  = exception.GetAppErrorCode();
                int httpErrorCode = exception.GetHttpErrorCode();

                string errorMsg = string.Empty;

                switch (appErrorCode)
                {
                case 4601:
                    errorMsg = "ERROR: Friend request already sent for this user. Please add a different friend.";
                    break;

                case 1401:
                    errorMsg = "NETWORK ERROR: Client not Authorized. Please try again later.";
                    break;

                case 1500:
                    errorMsg = "NETWORK ERROR: A server error has occured. Please try again later.";
                    break;

                default:
                    // This is called when there are no requests for the user or the user has never used the buddy service yet
                    //	so it is not an error and we set the OperationSuccessful to true
                    AppServices.operationSuccessful = true;
                    AppServices.app42LoadedRequests = true;
                    return;
                }

                //_friendsModel._page.SetProgressIndicatorAsync(false, string.Empty);
                //_friendsModel._page.DisplayFriendRequestsListAsync();
                //_friendsModel._page.EnableInputAsync();

                AppServices.operationSuccessful = false;
                AppServices.errorMessage        = errorMsg;
                AppServices.app42LoadedRequests = true;
            }
Exemplo n.º 21
0
 public void OnException(App42Exception exception)
 {
     AppServices.errorMessage        = "Incorrect usesrname or password. Please try again.";
     AppServices.app42Authenticated  = true;
     AppServices.operationSuccessful = false;
 }
Exemplo n.º 22
0
			public void OnException(App42Exception exception)
			{
				int appErrorCode = exception.GetAppErrorCode();
				int httpErrorCode = exception.GetHttpErrorCode();

				string errorMsg = string.Empty;
				switch (appErrorCode)
				{
					case 4601:
						errorMsg = "ERROR: Friend request already sent for this user. Please add a different friend.";
						break;					
					case 1401:
						errorMsg = "NETWORK ERROR: Client not Authorized. Please try again later.";
						break;
					case 1500:
						errorMsg = "NETWORK ERROR: A server error has occured. Please try again later.";
						break;
					default:
						// This is called when there are no requests for the user or the user has never used the buddy service yet
						//	so it is not an error and we set the OperationSuccessful to true
						AppServices.operationSuccessful = true;
						AppServices.app42LoadedRequests = true;
						return;
				}

				//_friendsModel._page.SetProgressIndicatorAsync(false, string.Empty);
				//_friendsModel._page.DisplayFriendRequestsListAsync();
				//_friendsModel._page.EnableInputAsync();

				AppServices.operationSuccessful = false;
				AppServices.errorMessage = errorMsg;
				AppServices.app42LoadedRequests = true;
			}
Exemplo n.º 23
0
 public void OnException(App42Exception exception)
 {
     AppServices.operationSuccessful = false;
     AppServices.errorMessage        = "ERROR: unable to remove friend. Please check your network connection and try agian.";
     AppServices.operationComplete   = true;
 }
Exemplo n.º 24
0
 void App42Callback.OnException(App42Exception exception)
 {
     Dispatcher.BeginInvoke(() => { textB.Text = "Exception Caught"; });
 }
Exemplo n.º 25
0
		public void OnException(App42Exception exception)
		{

		}
Exemplo n.º 26
0
 public void OnException(App42Exception exception)
 {
 }
Exemplo n.º 27
0
 public void OnException(App42Exception exception)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 28
0
		public void OnException(App42Exception exception)
		{
			AppServices.operationSuccessful = false;
			AppServices.errorMessage = "ERROR: Unable to accept request. Please try again.";
			AppServices.operationComplete = true;
		}
Exemplo n.º 29
0
			public void OnException(App42Exception exception)
			{
				AppServices.operationSuccessful = false;
				AppServices.errorMessage = "ERROR: unable to remove friend. Please check your network connection and try agian.";
				AppServices.operationComplete = true;
			}
 void App42Callback.OnException(App42Exception exception)
 {
     Dispatcher.BeginInvoke(() => { textB.Text = "Exception Caught"; });
 }
Exemplo n.º 31
0
			public void OnException(App42Exception exception)
			{
				AppServices.errorMessage = "Incorrect usesrname or password. Please try again.";
				AppServices.app42Authenticated = true;
				AppServices.operationSuccessful = false;
			}
Exemplo n.º 32
0
		// This will be called if there is an error or if there is no session. Error handling is currently not implemented we just assume
		//	that there is no session
		public void OnException(App42Exception exception)
		{
			int appErrorCode = exception.GetAppErrorCode();
			int httpErrorCode = exception.GetHttpErrorCode();
			if (appErrorCode == 2202)
			{
				// Handle here for Not Found (Session with the id '@sessionId' does not exist.) 
				AppServices.operationSuccessful = false;
				AppServices.errorMessage = "INPUT ERROR: User does not exist. Cannot check for session.";
				AppServices.isFriendOnline = true;
				AppServices.operationComplete = true;
				return;
			}
			// This is called when the user is simply offline. So it is not really an error.
			else if (appErrorCode == 2203)
			{
				// Handle here for Bad Request (The request parameters are invalid. Session with the Id '@sessionId' is already invalidated.) 
				AppServices.isFriendOnline = false;
			}
			else if (appErrorCode == 1401)
			{
				// handle here for Client is not authorized
				AppServices.operationSuccessful = false;
				AppServices.errorMessage = "NETWORK ERROR: Client not authorized to check for session.";
				AppServices.isFriendOnline = true;
				AppServices.operationComplete = true;
				return;
			}
			else if (appErrorCode == 1500)
			{
				// handle here for Internal Server Error  
				AppServices.operationSuccessful = false;
				AppServices.errorMessage = "NETWORK ERROR: An internal server error has occured while attempting check for a session.";
				AppServices.isFriendOnline = true;
				AppServices.operationComplete = true;
				return;
			}
			AppServices.operationSuccessful = true;
			AppServices.operationComplete = true;
		}
Exemplo n.º 33
0
		public void OnException(App42Exception exception)
		{
			App42Exception ex = (App42Exception)exception;
			int appErrorCode = exception.GetAppErrorCode();
			int httpErrorCode = exception.GetHttpErrorCode();

			// Attempt to get the mutex to update the number of friends sessions processed
			AppServices.friendCountMutex.WaitOne();
			AppServices.numFriendsProcessed++;

			// If all friends have been processed we signify the main thread we are done
			if (AppServices.numFriendsProcessed == AppServices.friendsData.friendsList.Count)
			{
				AppServices.friendCountMutex.ReleaseMutex();
				AppServices.operationSuccessful = true;
				AppServices.app42LoadedFriends = true;
				return;
			}

			AppServices.friendCountMutex.ReleaseMutex();
		}
Exemplo n.º 34
0
 public void OnException(App42Exception exception)
 {
     System.Diagnostics.Debug.WriteLine(":::EXCEPTION ::: " + exception.ToString());
     HideLoading();
     ShowMessage("Exception while storing Device Token to App42 cloud.", NotifyType.ErrorMessage);
 }
Exemplo n.º 35
0
 public void OnException(App42Exception exception)
 {
     AppServices.operationSuccessful = false;
     AppServices.errorMessage        = "ERROR: Unable to accept request. Please try again.";
     AppServices.operationComplete   = true;
 }
Exemplo n.º 36
0
			public void OnException(App42Exception exception)
			{
				int appErrorCode = exception.GetAppErrorCode();  
				int httpErrorCode = exception.GetHttpErrorCode();  
				if(appErrorCode == 4601)  
				{  
					//Handle here for Bad Request (The request parameters are invalid. Request already sent for user 'Nick')  
				}  
				else if(appErrorCode == 1401)  
				{  
					// handle here for Client is not authorized  
				}  
				else if(appErrorCode == 1500)  
				{  
					// handle here for Internal Server Error  
				}  

				AppServices.operationSuccessful = false;
				AppServices.operationComplete = true;
			}
        public void OnException(Exception e)
        {
            App42Exception exception = (App42Exception)e;

            result = exception.GetAppErrorCode();
        }
Exemplo n.º 38
0
        // Sample code for building a localized ApplicationBar
        //private void BuildLocalizedApplicationBar()
        //{
        //    // Set the page's ApplicationBar to a new instance of ApplicationBar.
        //    ApplicationBar = new ApplicationBar();

        //    // Create a new button and set the text value to the localized string from AppResources.
        //    ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative));
        //    appBarButton.Text = AppResources.AppBarButtonText;
        //    ApplicationBar.Buttons.Add(appBarButton);

        //    // Create a new menu item with the localized string from AppResources.
        //    ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText);
        //    ApplicationBar.MenuItems.Add(appBarMenuItem);
        //}

        public void OnException(App42Exception exception)
        {
            throw new NotImplementedException();
        }
 // callback when get an Exception.
 void App42Callback.OnException(App42Exception exception)
 {
     if (exception.GetAppErrorCode().Equals(3107))
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show("Currently No Comments Found On This Image.");
         });
     } 
     else if (exception.GetAppErrorCode().Equals(3106))
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show("Same Comment Could not be send.");
         });
     }
     else
     {
         Deployment.Current.Dispatcher.BeginInvoke(() =>
         {
             MessageBox.Show(exception.Message.ToString());
         });
     }
     
 }
 // App42 callback when exception
 void App42Callback.OnException(App42Exception exception)
 {
     Deployment.Current.Dispatcher.BeginInvoke(() =>
     {
         MessageBox.Show(exception.Message);
     });
 }
Exemplo n.º 41
0
 public void OnException(App42Exception exception)
 {
     Global.temp = exception.Message;
 }
Exemplo n.º 42
0
			public void OnException(App42Exception exception)
			{
				int appErrorCode = exception.GetAppErrorCode();
				int httpErrorCode = exception.GetHttpErrorCode();

				string errorMsg = string.Empty;
				switch (appErrorCode)
				{
					case 4600:
						errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
						break;
					case 4601:
						errorMsg = "USAGE ERROR: Friend request already sent for this user. Please add a different friend.";
						break;
					case 4602:
						errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
						break;
					case 4603:
						errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
						break;
					case 4604:
						// User has no friends yet so the App42 API's return this error code. This will always happen for new users
						//	and user's with empty friends lists but it is not really an error
						AppServices.operationSuccessful = true;
						AppServices.app42LoadedFriends = true;
						return;
					case 4613:
						errorMsg = "USAGE ERROR: The entered username is already on your friends list. Please add a different friend.";
						break;
					default:
						errorMsg = "ERROR: An error has occured. Please check your network connection and username entry and try again.";
						break;
				}

				AppServices.operationSuccessful = false;
				AppServices.errorMessage = errorMsg;
				AppServices.app42LoadedFriends = true;

				//_friendsModel._page.SetProgressIndicatorAsync(false, string.Empty);
				//_friendsModel._page.EnableInputAsync();
				//_friendsModel._page.PrintMessage(errorMsg);
			}
Exemplo n.º 43
0
			public void OnException(App42Exception exception)
			{
				int appErrorCode = exception.GetAppErrorCode();
				int httpErrorCode = exception.GetHttpErrorCode();

				string errorMsg = string.Empty;
				switch (appErrorCode)
				{
					case 0:
						errorMsg = "ENTRY ERROR: Username cannot be blank. Please try again.";
						break;
					case 4600:
						errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
						break;
					case 4601:
						errorMsg = "USAGE ERROR: Friend request already sent for this user. Please add a different friend.";
						break;
					case 4602:
						errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
						break;
					case 4603:
						errorMsg = "ENTRY ERROR: Username entered does not exist. Please try again.";
						break;
					case 4613:
						errorMsg = "USAGE ERROR: The entered username is already on your friends list. Please add a different friend.";
						break;
					default:
						errorMsg = "ERROR: An error has occured. Please check your network connection and username entry and try again.";
						break;
				}

				AppServices.operationSuccessful = false;
				AppServices.errorMessage = errorMsg;
				AppServices.operationComplete = true;
			}
Exemplo n.º 44
0
			public void OnException(App42Exception exception)
			{
				int appErrorCode = exception.GetAppErrorCode();
				int httpErrorCode = exception.GetHttpErrorCode();

				string errorMsg = string.Empty;

				switch (appErrorCode)
				{
					case 1400:
						errorMsg = "Network Error: The request parameters are invalid. Please check your network connection and try again.";
						break;
					case 1401:
						errorMsg = "Unauthorized Access Error: The client is not authorized to add a user.";
						break;
					case 1500:
						errorMsg = "Internal Server Error: Please try again.";
						break;
					case 2200:
						errorMsg = "Service Error: User by the given name does not exist.";
						break;
					case 2201:
						errorMsg = "Service Error: Session for user does not exist.";
						break;
					case 2202:
						errorMsg = "Service Error: Session with the given id does not exist.";
						break;
					case 2203:
						errorMsg = "Service Error: Bad request. The session for the given ID is already invalidated.";
						break;
					default:
						errorMsg = "Unknown Error: An unknown error has occured. Please check your network connection and try again.";
						break;
				}

				AppServices.errorMessage = errorMsg;
				AppServices.operationSuccessful = false;
				AppServices.app42LoggedIn = true;
			}
Exemplo n.º 45
0
 public void OnException(App42Exception exception)
 {
     System.Diagnostics.Debug.WriteLine(":::EXCEPTION ::: " + exception.ToString());
     new WNSCallback().HideLoading();
     new WNSCallback().ShowMessage("EXCEPTION SENDING PUSH.", NotifyType.ErrorMessage);
 }
Exemplo n.º 46
0
 public void OnException(App42Exception exception)
 {
     Deployment.Current.Dispatcher.BeginInvoke(new App42ApiResultCallback(mShowResultCallback), exception, true);
 }
Exemplo n.º 47
0
 public void OnException(App42Exception exception)
 {
     Deployment.Current.Dispatcher.BeginInvoke(new App42ApiResultCallback(mShowResultCallback), exception, true);
 }
Exemplo n.º 48
0
 public void OnException(App42Exception exception)
 {
     Global.temp = exception.Message;
 }