示例#1
0
        private void NewChildKey(AccountKey extendedKey)
        {
            try
            {
                NameWindow newNameWindow = new NameWindow();

                newNameWindow.NamespaceKey = extendedKey.KeyNamespace;

                if (newNameWindow.ShowDialog() == true)
                {
                    string     hdPath = tcBitcoin.NewKeyPath(extendedKey.KeyName, newNameWindow.KeyName);
                    AccountKey newKey = new AccountKey(hdPath, $"{extendedKey.KeyNamespace}.{newNameWindow.KeyName.ToUpper().Replace(' ', '_')}", newNameWindow.KeyName, 0, 0);
                    newKey.Key = tcBitcoin.GetExtendedKey(hdPath);
                    extendedKey.Items.Add(newKey);
                    extendedKey.IsExpanded = true;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show($"{err.Message}", $"{err.Source}.{err.TargetSite.Name}", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }