Beispiel #1
0
        private void RenameKey(AccountKey extendedKey)
        {
            try
            {
                NameWindow newNameWindow = new NameWindow();

                newNameWindow.NamespaceKey = extendedKey.KeyNamespace;
                newNameWindow.KeyName      = extendedKey.KeyName;

                if (newNameWindow.ShowDialog() == true)
                {
                    extendedKey.KeyNamespace = tcBitcoin.RenameKey(extendedKey.KeyName, newNameWindow.KeyName);
                    extendedKey.KeyName      = newNameWindow.KeyName;
                    textNamespace.Text       = extendedKey.KeyNamespace;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show($"{err.Message}", $"{err.Source}.{err.TargetSite.Name}", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Beispiel #2
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);
            }
        }