private void textBoxPinCode_TextChangedAsync(object sender, EventArgs e) { if (textBoxPinCode.Text.Length >= 4) { new Thread(async delegate() { if (!await ClassWalletObject.WalletConnect .SendPacketWallet( ClassWalletCommand.ClassWalletSendEnumeration.PinPhase + "|" + textBoxPinCode.Text, ClassWalletObject.Certificate, true)) { ClassWalletObject.FullDisconnection(true); ClassFormPhase.SwitchFormPhase(ClassFormPhaseEnumeration.Main); #if WINDOWS ClassFormPhase.MessageBoxInterface( ClassTranslation.GetLanguageTextFromOrder("PIN_CODE_SUBMIT_MENU_NETWORK_ERROR_TEXT"), string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("PIN_CODE_SUBMIT_MENU_NETWORK_ERROR_TEXT")); #endif } MethodInvoker invoke = () => textBoxPinCode.Text = string.Empty; BeginInvoke(invoke); ClassParallelForm.PinFormShowed = false; invoke = () => Hide(); BeginInvoke(invoke); }).Start(); } }
private void ButtonValidSetting_Click(object sender, EventArgs e) { if (radioButtonEnableSeedNodeSync.Checked) { ClassWalletObject.WalletSyncMode = (int)ClassWalletSyncMode.WALLET_SYNC_DEFAULT; } else if (radioButtonEnablePublicRemoteNodeSync.Checked) { ClassWalletObject.WalletSyncMode = (int)ClassWalletSyncMode.WALLET_SYNC_PUBLIC_NODE; } else if (radioButtonEnableManualRemoteNodeSync.Checked) { ClassWalletObject.WalletSyncMode = (int)ClassWalletSyncMode.WALLET_SYNC_MANUAL_NODE; ClassWalletObject.WalletSyncHostname = textBoxRemoteNodeHost.Text; } ClassWalletSetting.SaveSetting(); ClassWalletObject.FullDisconnection(true); ClassFormPhase.WalletXiropht.SwitchForm(ClassFormPhaseEnumeration.OpenWallet); #if WINDOWS MetroMessageBox.Show(this, ClassTranslation.GetLanguageTextFromOrder("REMOTE_NODE_SETTING_MENU_SAVE_SETTING_TEXT")); #else MessageBox.Show(this, ClassTranslation.GetLanguageTextFromOrder("REMOTE_NODE_SETTING_MENU_SAVE_SETTING_TEXT")); #endif Close(); }
/// <summary> /// Insert a new wallet informations to the datbases file. /// </summary> /// <param name="walletAddress"></param> /// <param name="walletPublicKey"></param> /// <param name="walletPrivateKey"></param> /// <param name="walletPinCode"></param> /// <param name="walletPassword"></param> public static async void InsertNewWalletAsync(string walletAddress, string walletPublicKey, string walletPrivateKey, string walletPinCode, string walletPassword) { await Task.Factory.StartNew(delegate { InSave = true; bool success = false; while (!success) { try { if (!RpcDatabaseContent.ContainsKey(walletAddress)) { string encryptedWallet = ClassAlgo.GetEncryptedResultManual(ClassAlgoEnumeration.Rijndael, walletAddress + "|" + walletPublicKey + "|" + walletPrivateKey + "|" + walletPinCode + "|" + walletPassword, RpcDatabasePassword, ClassWalletNetworkSetting.KeySize); RpcDatabaseStreamWriter.WriteLine(ClassRpcDatabaseEnumeration.DatabaseWalletStartLine + encryptedWallet); var walletObject = new ClassWalletObject(walletAddress, walletPublicKey, walletPassword, walletPrivateKey, walletPinCode, encryptedWallet); RpcDatabaseContent.Add(walletAddress, walletObject); } success = true; } catch { RpcDatabaseStreamWriter = new StreamWriter(ClassUtility.ConvertPath(AppDomain.CurrentDomain.BaseDirectory + RpcDatabaseFile), true, Encoding.UTF8, 8192) { AutoFlush = true }; } } InSave = false; }, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Current); }
public void ResyncBlock() { if (ClassBlockCache.RemoveWalletBlockCache()) { ClassFormPhase.WalletXiropht.ListBlockHashShowed.Clear(); ClassWalletObject.DisconnectWholeRemoteNodeSyncAsync(true, true); } }
public void ResyncTransaction() { ClassWalletObject.BlockTransactionSync = true; ClassFormPhase.WalletXiropht.StopUpdateTransactionHistory(true, true); if (ClassWalletTransactionCache.RemoveWalletCache(ClassWalletObject.WalletConnect.WalletAddress)) { if (ClassWalletTransactionAnonymityCache.RemoveWalletCache(ClassWalletObject.WalletConnect.WalletAddress)) { ClassWalletTransactionCache.ListTransaction.Clear(); ClassWalletTransactionAnonymityCache.ListTransaction.Clear(); ClassWalletObject.InSyncTransaction = false; ClassWalletObject.InSyncTransactionAnonymity = false; ClassWalletObject.BlockTransactionSync = false; ClassWalletObject.DisconnectWholeRemoteNodeSyncAsync(true, true); ClassFormPhase.WalletXiropht.EnableUpdateTransactionWallet = false; ClassFormPhase.WalletXiropht.StopAndRestartTransactionHistory(); } } }
/// <summary> /// Load RPC Database file. /// </summary> /// <returns></returns> public static bool LoadRpcDatabaseFile() { RpcDatabaseContent = new Dictionary <string, ClassWalletObject>(); try { if (File.Exists(ClassUtility.ConvertPath(AppDomain.CurrentDomain.BaseDirectory + RpcDatabaseFile))) { using (FileStream fs = File.Open(ClassUtility.ConvertPath(AppDomain.CurrentDomain.BaseDirectory + RpcDatabaseFile), FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (BufferedStream bs = new BufferedStream(fs)) { using (StreamReader sr = new StreamReader(bs)) { string line; int lineRead = 0; while ((line = sr.ReadLine()) != null) { lineRead++; if (line.StartsWith(ClassRpcDatabaseEnumeration.DatabaseWalletStartLine)) { string walletData = line.Replace(ClassRpcDatabaseEnumeration.DatabaseWalletStartLine, ""); walletData = ClassAlgo.GetDecryptedResultManual(ClassAlgoEnumeration.Rijndael, walletData, RpcDatabasePassword, ClassWalletNetworkSetting.KeySize); if (walletData != ClassAlgoErrorEnumeration.AlgoError) { var splitWalletData = walletData.Split(new[] { "|" }, StringSplitOptions.None); var walletAddress = splitWalletData[0]; if (!RpcDatabaseContent.ContainsKey(walletAddress)) { var walletPublicKey = splitWalletData[1]; var walletPrivateKey = splitWalletData[2]; var walletPinCode = splitWalletData[3]; var walletPassword = splitWalletData[4]; var walletObject = new ClassWalletObject(walletAddress, walletPublicKey, walletPassword, walletPrivateKey, walletPinCode, walletData); if (!RpcDatabaseContent.ContainsKey(walletAddress)) { RpcDatabaseContent.Add(walletAddress, walletObject); } } } else { ClassConsole.ConsoleWriteLine("Decrypt database of wallets failed at line: " + lineRead); return(false); } } } } } } } else { File.Create(ClassUtility.ConvertPath(AppDomain.CurrentDomain.BaseDirectory + RpcDatabaseFile)).Close(); } } catch { return(false); } RpcDatabaseStreamWriter = new StreamWriter(ClassUtility.ConvertPath(AppDomain.CurrentDomain.BaseDirectory + RpcDatabaseFile), true, Encoding.UTF8, 8192) { AutoFlush = true }; return(true); }
/// <summary> /// Add transaction to the list. /// </summary> /// <param name="transaction"></param> public static async Task AddWalletTransactionAsync(string transaction) { try { #if DEBUG Log.WriteLine("Wallet transaction history received: " + transaction .Replace( ClassRemoteNodeCommandForWallet.RemoteNodeRecvPacketEnumeration .WalletTransactionPerId, "")); #endif var splitTransaction = transaction.Replace( ClassRemoteNodeCommandForWallet.RemoteNodeRecvPacketEnumeration.WalletTransactionPerId, "").Split(new[] { "#" }, StringSplitOptions.None); var type = splitTransaction[0]; var timestamp = splitTransaction[3]; // Timestamp Send CEST. var hashTransaction = splitTransaction[4]; // Transaction Hash. var realFeeAmountSend = splitTransaction[7]; // Real fee and amount crypted for sender. var realFeeAmountRecv = splitTransaction[8]; // Real fee and amount crypted for sender. var decryptKey = ClassWalletObject.WalletConnect.WalletAddress + ClassWalletObject.WalletConnect.WalletKey; // Wallet Address + Wallet Public Key var amountAndFeeDecrypted = "NULL"; if (type == "SEND") { amountAndFeeDecrypted = ClassAlgo.GetDecryptedResultManual(ClassAlgoEnumeration.Rijndael, realFeeAmountSend, decryptKey, ClassWalletNetworkSetting.KeySize); // AES } else if (type == "RECV") { amountAndFeeDecrypted = ClassAlgo.GetDecryptedResultManual(ClassAlgoEnumeration.Rijndael, realFeeAmountRecv, decryptKey, ClassWalletNetworkSetting.KeySize); // AES } if (amountAndFeeDecrypted != "NULL" && amountAndFeeDecrypted != ClassAlgoErrorEnumeration.AlgoError) { var splitDecryptedAmountAndFee = amountAndFeeDecrypted.Split(new[] { "-" }, StringSplitOptions.None); var amountDecrypted = splitDecryptedAmountAndFee[0]; var feeDecrypted = splitDecryptedAmountAndFee[1]; var walletDstOrSrc = splitDecryptedAmountAndFee[2]; var timestampRecv = splitTransaction[5]; // Timestamp Recv CEST. var blockchainHeight = splitTransaction[6]; // Blockchain height. var finalTransaction = type + "#" + hashTransaction + "#" + walletDstOrSrc + "#" + amountDecrypted + "#" + feeDecrypted + "#" + timestamp + "#" + timestampRecv + "#" + blockchainHeight; var finalTransactionEncrypted = ClassAlgo.GetEncryptedResultManual(ClassAlgoEnumeration.Rijndael, finalTransaction, ClassWalletObject.WalletConnect.WalletAddress + ClassWalletObject.WalletConnect.WalletKey, ClassWalletNetworkSetting.KeySize); // AES if (finalTransactionEncrypted == ClassAlgoErrorEnumeration.AlgoError) // Ban bad remote node. { if (!ClassConnectorSetting.SeedNodeIp.ContainsKey(ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost)) { if (!ClassWalletObject.ListRemoteNodeBanned.ContainsKey(ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost)) { ClassWalletObject.ListRemoteNodeBanned.Add(ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost, ClassUtils.DateUnixTimeNowSecond()); } else { ClassWalletObject.ListRemoteNodeBanned[ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost] = ClassUtils.DateUnixTimeNowSecond(); } } ClassWalletObject.DisconnectWholeRemoteNodeSyncAsync(true, true); } else { var existTransaction = false; if (ListTransaction.ContainsValue(finalTransactionEncrypted)) { existTransaction = true; } if (!existTransaction) { ListTransaction.Add(ListTransaction.Count, finalTransactionEncrypted); await SaveWalletCache(ClassWalletObject.WalletConnect.WalletAddress, finalTransactionEncrypted, false); #if DEBUG Log.WriteLine("Total transactions downloaded: " + ListTransaction.Count + "/" + ClassWalletObject.TotalTransactionInSync + "."); #endif } } } else { #if DEBUG Log.WriteLine("Can't decrypt transaction: " + transaction + " result: " + amountAndFeeDecrypted); #endif if (!ClassConnectorSetting.SeedNodeIp.ContainsKey(ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost)) { if (!ClassWalletObject.ListRemoteNodeBanned.ContainsKey(ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost)) { ClassWalletObject.ListRemoteNodeBanned.Add(ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost, ClassUtils.DateUnixTimeNowSecond()); } else { ClassWalletObject.ListRemoteNodeBanned[ClassWalletObject.ListWalletConnectToRemoteNode[8].RemoteNodeHost] = ClassUtils.DateUnixTimeNowSecond(); } } ClassWalletObject.DisconnectWholeRemoteNodeSyncAsync(true, true); } } catch { } ClassWalletObject.InReceiveTransaction = false; }
private void ButtonClose_Click(object sender, EventArgs e) { ClassWalletObject.FullDisconnection(true); Hide(); }
private async Task CreateWalletAsync() { if (InCreation) { ClassWalletObject.FullDisconnection(true); InCreation = false; } if (textBoxPathWallet.Text != "") { if (textBoxSelectWalletPassword.Text != "") { if (await ClassWalletObject .InitializationWalletConnection("", textBoxSelectWalletPassword.Text, "", ClassWalletPhase.Create)) { ClassWalletObject.WalletNewPassword = textBoxSelectWalletPassword.Text; ClassWalletObject.ListenSeedNodeNetworkForWallet(); InCreation = true; ClassWalletObject.WalletDataCreationPath = textBoxPathWallet.Text; new Thread(async delegate() { Stopwatch packetSpeedCalculator = new Stopwatch(); packetSpeedCalculator.Start(); if (await ClassWalletObject.WalletConnect .SendPacketWallet(ClassWalletObject.Certificate, string.Empty, false)) { packetSpeedCalculator.Stop(); if (packetSpeedCalculator.ElapsedMilliseconds > 0) { Thread.Sleep((int)packetSpeedCalculator.ElapsedMilliseconds); } if (!await ClassWalletObject .SendPacketWalletToSeedNodeNetwork( ClassWalletCommand.ClassWalletSendEnumeration.CreatePhase + "|" + textBoxSelectWalletPassword.Text)) { #if WINDOWS ClassFormPhase.MessageBoxInterface( ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT"), string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MethodInvoker invoke = () => MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT")); ClassFormPhase.WalletXiropht.BeginInvoke(invoke); #endif } void MethodInvoker() => textBoxSelectWalletPassword.Text = ""; BeginInvoke((MethodInvoker)MethodInvoker); } else { #if WINDOWS ClassFormPhase.MessageBoxInterface( ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT"), string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MethodInvoker invoke = () => MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT")); ClassFormPhase.WalletXiropht.BeginInvoke(invoke); #endif } }).Start(); } } } }
/// <summary> /// Open and connect the wallet. /// </summary> /// <returns></returns> private void OpenAndConnectWallet() { if (textBoxPasswordWallet.Text == "") { #if WINDOWS ClassFormPhase.MessageBoxInterface(ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NO_PASSWORD_WRITTED_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NO_PASSWORD_WRITTED_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Warning); #else MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NO_PASSWORD_WRITTED_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NO_PASSWORD_WRITTED_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Warning); #endif return; } new Thread(async delegate() { try { bool error = false; string passwordEncrypted = ClassAlgo.GetEncryptedResultManual(ClassAlgoEnumeration.Rijndael, textBoxPasswordWallet.Text, textBoxPasswordWallet.Text, ClassWalletNetworkSetting.KeySize); ClassWalletObject.WalletDataDecrypted = ClassAlgo.GetDecryptedResultManual(ClassAlgoEnumeration.Rijndael, _walletFileData, passwordEncrypted, ClassWalletNetworkSetting.KeySize); // AES if (ClassWalletObject.WalletDataDecrypted == ClassAlgoErrorEnumeration.AlgoError) { error = true; } if (error) { ClassWalletObject.WalletDataDecrypted = ClassAlgo.GetDecryptedResultManual(ClassAlgoEnumeration.Rijndael, _walletFileData, textBoxPasswordWallet.Text, ClassWalletNetworkSetting.KeySize); // AES } if (ClassWalletObject.WalletDataDecrypted == ClassAlgoErrorEnumeration.AlgoError) { #if WINDOWS ClassFormPhase.MessageBoxInterface( ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_WRONG_PASSWORD_WRITTED_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_WRONG_PASSWORD_WRITTED_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_WRONG_PASSWORD_WRITTED_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_WRONG_PASSWORD_WRITTED_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Error); #endif return; } var splitWalletFileDecrypted = ClassWalletObject.WalletDataDecrypted.Split(new[] { "\n" }, StringSplitOptions.None); string walletAddress = splitWalletFileDecrypted[0]; string walletKey = splitWalletFileDecrypted[1]; if (!await ClassWalletObject.InitializationWalletConnection(walletAddress, textBoxPasswordWallet.Text, walletKey, ClassWalletPhase.Login)) { MethodInvoker invoker = () => textBoxPasswordWallet.Text = ""; BeginInvoke(invoker); #if WINDOWS ClassFormPhase.MessageBoxInterface( ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Warning); #else MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Warning); #endif return; } MethodInvoker invoke = () => textBoxPasswordWallet.Text = ""; BeginInvoke(invoke); ClassWalletObject.ListenSeedNodeNetworkForWallet(); Stopwatch packetSpeedCalculator = new Stopwatch(); packetSpeedCalculator.Start(); if (await ClassWalletObject.WalletConnect.SendPacketWallet(ClassWalletObject.Certificate, string.Empty, false)) { packetSpeedCalculator.Stop(); if (packetSpeedCalculator.ElapsedMilliseconds > 0) { Thread.Sleep((int)packetSpeedCalculator.ElapsedMilliseconds); } await ClassWalletObject.WalletConnect.SendPacketWallet( ClassConnectorSettingEnumeration.WalletLoginType + "|" + ClassWalletObject.WalletConnect.WalletAddress, ClassWalletObject.Certificate, true); _walletFileData = string.Empty; _fileSelectedPath = string.Empty; invoke = () => labelOpenFileSelected.Text = ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_LABEL_FILE_SELECTED_TEXT"); BeginInvoke(invoke); } } catch { #if WINDOWS ClassFormPhase.MessageBoxInterface( ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_WRONG_PASSWORD_WRITTED_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_WRONG_PASSWORD_WRITTED_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Error); #else MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_WRONG_PASSWORD_WRITTED_CONTENT_TEXT"), ClassTranslation.GetLanguageTextFromOrder("OPEN_WALLET_ERROR_MESSAGE_NETWORK_WRONG_PASSWORD_WRITTED_TITLE_TEXT"), MessageBoxButtons.OK, MessageBoxIcon.Error); #endif } }).Start(); }
private async void buttonRestoreYourWallet_ClickAsync(object sender, EventArgs e) { string walletPath = textBoxPathWallet.Text; string walletPassword = textBoxPassword.Text; string walletKey = textBoxPrivateKey.Text; walletKey = Regex.Replace(walletKey, @"\s+", string.Empty); textBoxPassword.Text = string.Empty; textBoxPathWallet.Text = string.Empty; textBoxPrivateKey.Text = string.Empty; if (await ClassWalletObject.InitializationWalletConnection(string.Empty, walletPassword, string.Empty, ClassWalletPhase.Create)) { ClassWalletObject.ListenSeedNodeNetworkForWallet(); ClassWalletObject.WalletDataCreationPath = walletPath; new Thread(async delegate() { Stopwatch packetSpeedCalculator = new Stopwatch(); packetSpeedCalculator.Start(); if (await ClassWalletObject.WalletConnect.SendPacketWallet(ClassWalletObject.Certificate, string.Empty, false)) { packetSpeedCalculator.Stop(); if (packetSpeedCalculator.ElapsedMilliseconds > 0) { Thread.Sleep(1000); } string requestRestoreQrCodeEncrypted = null; using (ClassWalletRestoreFunctions walletRestoreFunctions = new ClassWalletRestoreFunctions()) { requestRestoreQrCodeEncrypted = walletRestoreFunctions.GenerateQRCodeKeyEncryptedRepresentation(walletKey, walletPassword); if (requestRestoreQrCodeEncrypted != null) { ClassWalletObject.WalletNewPassword = walletPassword; ClassWalletObject.WalletPrivateKeyEncryptedQRCode = walletKey; if (!await ClassWalletObject.SeedNodeConnectorWallet.SendPacketToSeedNodeAsync(ClassWalletCommand.ClassWalletSendEnumeration.AskPhase + "|" + requestRestoreQrCodeEncrypted, ClassWalletObject.Certificate, false, true)) { #if WINDOWS ClassFormPhase.MessageBoxInterface(ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT"), string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MethodInvoker invoke = () => MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT")); ClassFormPhase.WalletXiropht.BeginInvoke(invoke); #endif } } else { #if WINDOWS ClassFormPhase.MessageBoxInterface("Invalid private key inserted.", string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MethodInvoker invoke = () => MessageBox.Show(ClassFormPhase.WalletXiropht, "Invalid private key inserted."); ClassFormPhase.WalletXiropht.BeginInvoke(invoke); #endif } } } else { #if WINDOWS ClassFormPhase.MessageBoxInterface( ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT"), string.Empty, MessageBoxButtons.OK, MessageBoxIcon.Error); #else MethodInvoker invoke = () => MessageBox.Show(ClassFormPhase.WalletXiropht, ClassTranslation.GetLanguageTextFromOrder("CREATE_WALLET_ERROR_CANT_CONNECT_MESSAGE_CONTENT_TEXT")); ClassFormPhase.WalletXiropht.BeginInvoke(invoke); #endif } }).Start(); } }