Example #1
0
        /// <summary>
        /// Initializes the pull profile button.
        /// </summary>
        /// <param name="u">The current UserInfo object</param>
        /// <param name="d">The current TagRideDataStore object</param>
        void InitPullProfileButton(UserInfo u, TagRideDataStore d)
        {
            var button = pullProfileButton;

            button.Text     = "Pull profile from cloud";
            button.Clicked += async(sender, e) => await PullProfileButtonClicked(u, d);
        }
Example #2
0
        /// <summary>
        /// Initializes the push profile button.
        /// </summary>
        /// <param name="u">The current UserInfo object.</param>
        /// <param name="d">The current TagRideDataStore object.</param>
        void InitPushProfileButton(UserInfo u, TagRideDataStore d)
        {
            var button = pushProfileButton;

            button.Text     = "Push profile to cloud";
            button.Clicked += async(sender, e) => await d.PostUserInfo(u);
        }
Example #3
0
        /// <summary>
        /// Inits button for deleting profile and photo from cloud storage.
        /// </summary>
        /// <param name="u">UuserInfo.</param>
        /// <param name="d">TagRideDataStore.</param>
        void InitDeleteProfileButton(UserInfo u, TagRideDataStore d)
        {
            var button = deleteProfileButton;

            button.Text = "Delete profile and logout";

            button.Clicked += async(sender, e) =>
            {
                await DeleteProfileButtonClicked(u, d);
            };
        }
Example #4
0
        /// <summary>
        /// Click event for deleteProfileButton.
        /// </summary>
        /// <returns>The profile button clicked.</returns>
        /// <param name="u">UserInfo.</param>
        /// <param name="d">TagRideDataStore.</param>
        async Task DeleteProfileButtonClicked(UserInfo u, TagRideDataStore d)
        {
            // Prompt for profile deletion
            bool deleteProfile = await DisplayAlert("Delete Profile",
                                                    "Permanently delete profile information and photo?", "Delete", "Cancel");

            if (deleteProfile)
            {
                await d.DeleteUserInfo(u);

                Login.LoginUtils.SetUserLoggedOut();
                App.Current.UserProfileManager.ResetWithoutPush();
                App.Current.ShowLogin();
            }
            else
            {
                return;
            }
        }
Example #5
0
        /// <summary>
        /// Click event for Pull Profile button async.
        /// </summary>
        /// <param name="u">App.Current.UserInfo</param>
        /// <param name="d">App.Current.DataStore</param>
        async Task PullProfileButtonClicked(UserInfo u, TagRideDataStore d)
        {
            UserInfo user = await d.GetUserInfo(u.UserId);

            u.UpdateToMatch(user);
        }