示例#1
0
        private void SetStateLight()
        {
            if (MainWallet == null)
            {
                StrokeStateLight = Colors.White;
                FillStateLight   = Colors.WhiteSmoke;
                return;
            }

            if (MainWallet.GetWalletConnState().Equals(WalletConnectionState.NotConnected))
            {
                StrokeStateLight = Colors.Firebrick;
                FillStateLight   = Colors.Crimson;
            }
            else if (MainWallet.GetWalletConnState().Equals(WalletConnectionState.Connecting))
            {
                StrokeStateLight = Colors.DarkOrange;
                FillStateLight   = Colors.Orange;
            }
            else if (MainWallet.GetWalletConnState().Equals(WalletConnectionState.Connected))
            {
                StrokeStateLight = Colors.LimeGreen;
                FillStateLight   = Colors.Chartreuse;
            }
        }
示例#2
0
        private async void ChangeActiveWallet(WalletModel wallet)
        {
            if (MainWallet == null)
            {
                this.SetupWallet(wallet);
                return;
            }
            else if (MainWallet.Equals(wallet))
            {
                string             titleSame   = TextTools.RetrieveStringFromResource("Main_Dialog_SameWallet_Title");
                string             messageSame = TextTools.RetrieveStringFromResource("Main_Dialog_SameWallet_Message");
                MessageDialogStyle styleSame   = MessageDialogStyle.Affirmative;
                await _mview.ShowMessageAsync(titleSame, messageSame, styleSame);

                return;
            }

            string             title   = TextTools.RetrieveStringFromResource("Main_Dialog_ActiveWallet_Title");
            string             message = TextTools.RetrieveStringFromResource("Main_Dialog_ActiveWallet_Message");
            MessageDialogStyle style   = MessageDialogStyle.AffirmativeAndNegative;

            var result = await _mview.ShowMessageAsync(title, message, style);

            if (result == MessageDialogResult.Affirmative)
            {
                this.CloseWallet();
                this.SetupWallet(wallet);
            }
        }
示例#3
0
        private void UpdateLanguage(string s)
        {
            Lang      = s;
            TextTitle = "JetWallet - " + Lang;

            this.TextNoWallet = TextTools.RetrieveStringFromResource("Main_NoWallet");
            this.TextSend     = TextTools.RetrieveStringFromResource("Main_Send");
            this.TextReceive  = TextTools.RetrieveStringFromResource("Main_Receive");

            if (WalletNotNull)
            {
                MainWallet.UpdateTxListLanguage();
                InfoTag = TextTools.RetrieveStringFromResource("Main_Info_Active");
            }
            else
            {
                InfoTag = TextTools.RetrieveStringFromResource("Main_Info_Inactive");
            }

            this.FileTab.UpdateText();
            this.SettingsTab.UpdateText();
            this.ResourceTab.UpdateText();

            this.StatusBarComp.UpdateText();
        }
示例#4
0
 private void ExecuteOpenWalletInfo()
 {
     if (WalletNotNull && MainWallet.GetWalletState().Equals(WalletModelState.Ready))
     {
         Messenger.Default.Send <string>("", "OpenWalletInfo");
     }
     else if (WalletNotNull && MainWallet.GetWalletState().Equals(WalletModelState.Preparing))
     {
         this.ShowWalletLoadingDialog();
     }
     else
     {
         this.ShowNoActiveWalletDialog();
     }
 }
示例#5
0
 private void ExecuteReceiveBitcoin()
 {
     if (WalletNotNull && MainWallet.GetWalletState().Equals(WalletModelState.Ready))
     {
         PubKey newScript = MainWallet.GetNewPubKey();
         string address   = newScript.GetAddress(MainWallet.NetworkChoice).ToString();
         Messenger.Default.Send <string>(address, "OpenReceiveView");
     }
     else if (WalletNotNull && MainWallet.GetWalletState().Equals(WalletModelState.Preparing))
     {
         this.ShowWalletLoadingDialog();
     }
     else
     {
         this.ShowNoActiveWalletDialog();
     }
 }
示例#6
0
        private void CloseWallet()
        {
            if (MainWallet == null)
            {
                return;
            }

            MainWallet.Close();
            MainWallet    = null;
            WalletNotNull = false;
            InfoTag       = TextTools.RetrieveStringFromResource("Main_Info_Inactive");
            this.SetStateLight();
            Global.VML.UiSettings.ClearNetwork();
            // Closing wallet results in
            // clearing the wallet path
            // from the conf file
            FileTools.ClearConfWalletSettings();
            Logger.StopLogging();
        }
示例#7
0
 private void UnlockWallet()
 {
     MainWallet.SetWalletSecurity(WalletSecurity.Unlock);
     this.ShowMainView();
 }
示例#8
0
 private void LockWallet()
 {
     MainWallet.SetWalletSecurity(WalletSecurity.Lock);
     this.HideMainView();
     CheckPassword.InvokePasswordPrompt(MainWallet.FileLocation);
 }