예제 #1
0
        public override void ProviderLoaded(object sender, ProviderLoadedEventArgs e)
        {
            base.ProviderLoaded(sender, e);

            Profile userProfile = null;

            switch (e.RequestCode)
            {
                case RC_GET_PROFILE:
                    if (e.IsSuccess)
                    {
                        userProfile = Parser.Serialize<Profile>();
                    }
                    break;
                default:
                    break;
            }

            if (ProfileEvent != null)
            {
                ProfileEventArgs profileEventArgs = new ProfileEventArgs(userProfile);
                profileEventArgs.LoadEventArgs(e);

                ProfileEvent(this, profileEventArgs);
            }
        }
예제 #2
0
 public void UserProfileEvent(object sender, ProfileEventArgs e)
 {
     Console.WriteLine(e.Payload);
 }
예제 #3
0
        public void UserProfileEvent(object sender, ProfileEventArgs e)
        {
            DialogHelper.Close();

            switch (e.RequestCode)
            {
                case ProfileProvider.RC_GET_PROFILE:
                    if (e.IsSuccess)
                    {
                        UserProfile = e.UserProfile;
                        MainViewModel.UserProfile = UserProfile;
                    }
                    break;
                default:
                    if (e.IsSuccess)
                    {
                        MainViewModel.UserProfile = UserProfile;
                        // Reset the secure field
                        ResetPasswordViewCommand.Execute(null);
                        // Notice the result
                        DialogHelper.Show("更新完成");
                    } else
                    {
                        DialogHelper.ShowError("更新失败,请稍后重试", e.ErrorMessage == null ? null :
                            e.ErrorMessage.ToArray());
                    }
                    break;
            }
        }