コード例 #1
0
        void ShowResult()
        {
            var result = WalletService.Default.ChangeWalletPassword(PassWordData.PassWord, PassWordData.NewPassWord1);

            if (!result.IsFail)
            {
                ShowMessage(LanguageService.Default.GetLanguageValue("page_changePwd_okCaption"));
                OnClosePopup();
            }
            else
            {
                ShowMessage(LanguageService.Default.GetLanguageValue("Error_enterOldPwd"));
                PassWordData.Reset();
            }
        }
コード例 #2
0
        public override void OnOkClick()
        {
            if (PassWordData.PwdPageType == PwdPageType.ChangePWD && PassWordData.PassWord == PassWordData.NewPassWord2)
            {
                ShowMessage(LanguageService.Default.GetLanguageValue(ValidationType.Error_NewPasswordDifferent.ToString()));
                return;
            }

            if (PassWordData.NewPassWord1 != PassWordData.NewPassWord2)
            {
                ShowMessage(LanguageService.Default.GetLanguageValue(ValidationType.Error_PasswordDifferent.ToString()));
                return;
            }

            var messageData = new MessagePageData();

            messageData.MsgType   = MsgType.Warwarning;
            messageData.PageTitle = LanguageService.Default.GetLanguageValue("messagePage_title_confirmPwd");
            messageData.MsgItems.Add(new MsgData(LanguageService.Default.GetLanguageValue("messagePage_title_confirmPwd_cation"), "#F65952"));
            messageData.MsgItems.Add(new MsgData(LanguageService.Default.GetLanguageValue("messagePage_title_confirmPwd_cation2"), "#333333"));
            switch (PassWordData.PwdPageType)
            {
            case PwdPageType.ChangePWD:
                var unlockreuslt = CheckOldPassword(PassWordData.PassWord);
                if (!unlockreuslt)
                {
                    ShowMessage(LanguageService.Default.GetLanguageValue("Error_enterOldPwd"));
                    return;
                }
                messageData.SetOkCallBack(ShowResult);
                break;

            case PwdPageType.EncryptedWallet:
                messageData.SetOkCallBack(EncryptWallet);
                messageData.SetCancelCallBack(() => { PassWordData.Reset(); });
                break;

            default:
                break;
            }


            SendMessenger(Pages.MessagePage, messageData);
            UpdatePage(Pages.MessagePage);
        }
コード例 #3
0
        void EncryptWallet()
        {
            var result = WalletService.Default.EncryptWallet(PassWordData.NewPassWord1);

            if (!result.IsFail)
            {
                var Msg = LanguageService.Default.GetLanguageValue("encryptSucceed");
                ShowMessage(Msg);
                Messenger.Default.Send(CommonTopic.UpdateWalletStatus);
                PassWordData.Reset();
            }
            else
            {
                PassWordData.Reset();
                var errorMsg = result.GetErrorMsg();
                if (string.IsNullOrEmpty(errorMsg))
                {
                    errorMsg = LanguageService.Default.GetLanguageValue("encryptFail");
                }
                ShowMessage(errorMsg);
            }
        }
コード例 #4
0
 public override void OnClosePopup()
 {
     base.OnClosePopup();
     PassWordData.Reset();
 }