void Import(string file, string password = null) { var exportResult = WalletService.Default.ImportBackupWallet(file, password); if (!exportResult.IsFail) { //ShowMessage(LanguageService.Default.GetLanguageValue(MessageKeys.Import_sucesses)); MessagePageData data = new MessagePageData(); data.PageTitle = LanguageService.Default.GetLanguageValue(MessageKeys.Import_sucesses); MsgData iconData = new MsgData("path_msg_warming", Colors.Red); data.IconData = iconData; data.MsgItems.Add(new MsgData(LanguageService.Default.GetLanguageValue("Import_caption1"), Colors.Red)); data.MsgItems.Add(new MsgData(LanguageService.Default.GetLanguageValue("Import_caption2"), "#333333")); data.MsgBtnShowType = MsgBtnType.Ok; data.CloseIsWord = true; data.CloseWord = ""; data.SetOkCallBack(RestartApp); SendMessenger(Pages.MessagePage, data); UpdatePage(Pages.MessagePage); } else { ShowMessage(LanguageService.Default.GetLanguageValue(MessageKeys.Import_Fail)); OnClosePopup(); } }
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); }