private void CalculateFromValidShares() { if (liCurrShares.Count < 3) { return; } clsBIP39Splitter merger = new clsBIP39Splitter(); byte[] baSeed; string sRet = merger.JoinSecrets(liCurrShares, out baSeed, txtPassword.Text); if (sRet != "") { txtMerged.Text = sRet; txtMerged.Background = new SolidColorBrush(Colors.LightSalmon); return; } try { clsSeed seed = new clsSeed(baSeed); txtMerged.Text = seed.SeedString; txtMerged.Background = new SolidColorBrush(Colors.LightGreen); } catch (Exception ex) { txtMerged.Text = $"Wrong password used ({ex.Message})"; txtMerged.Background = new SolidColorBrush(Colors.LightSalmon); } }
private void lstSplitShares_SelectionChanged(object sender, SelectionChangedEventArgs e) { List <string> liSelShares = new List <string>(); foreach (ucShare uc1 in lstSplitShares.SelectedItems) { liSelShares.Add(uc1.txtShare.Text); } if (liSelShares.Count < 2) { return; } clsBIP39Splitter merger = new clsBIP39Splitter(); byte[] baSecret; string sRet = merger.JoinSecrets(liSelShares, out baSecret, txtPassword.Text); if (sRet != "") { txtTestMerged.Text = sRet; txtTestMerged.Background = new SolidColorBrush(Colors.Yellow); return; } try { clsSeed seed = new clsSeed(baSecret); txtTestMerged.Text = seed.SeedString; if (txtSeedToSplit.Text == txtTestMerged.Text) { txtTestMerged.Background = new SolidColorBrush(Colors.LightGreen); } else { txtTestMerged.Background = new SolidColorBrush(Colors.LightSalmon); } } catch (Exception ex) { txtTestMerged.Text = $"Wrong password used ({ex.Message})"; txtTestMerged.Background = new SolidColorBrush(Colors.LightSalmon); } }