Пример #1
0
        /// <summary>
        /// Saves the user data.
        /// </summary>
        private void Save()
        {
            // If already saving information
            if (this.IsBusy)
            {
                return;
            }

            // Validate that the notification type is valid
            if (this.NotificationTypeIndex < 0)
            {
                App.DisplayAlert(
                    Localization.ErrorDialogTitle,
                    Localization.ErrorInvalidNotificationTypes,
                    Localization.DialogDismiss);
                return;
            }

            // Prepare the data to be send to the server
            var request = new Json.JsonObject {
                { "notification_types", this.NotificationTypeIndex }
            };

            // Send request to the server
            this.IsBusy = true;
            WebHelper.SendAsync(
                Uris.GetUpdateUserInfoUri(),
                request.AsHttpContent(),
                this.ProcessSaveResult,
                () => this.IsBusy = false);
        }