private void MergeSecret_Click(object sender, RoutedEventArgs e) { try { var parts = textParts.Text.Trim().Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); textSecret.Text = SecretSharing.MergeSecret(parts); } catch (Exception ex) { textSecret.Text = $"{ex.GetType()}:{ex.Message}"; } }
private void SplitSecret_Click(object sender, RoutedEventArgs e) { var parts = SecretSharing.SplitSecret(textSecret.Text, int.Parse(textNeededCount.Text), int.Parse(textTotalCount.Text)); textParts.Text = string.Join("\n", parts); }