protected void OnCopyUri(string id)
        {
            if (string.IsNullOrEmpty(id) || SelectedItem == null)
            {
                return;
            }

            if (id == "address")
            {
                ClipboardUtil.SetText(SelectedItem.Payment.Address);
            }
            else if (id == "amount")
            {
                ClipboardUtil.SetText((SelectedItem.Payment.Amount / Math.Pow(10, 8)).ToString("0.00000000"));
            }
            else if (id == "label")
            {
                PaymentToMarkConverter converter = new PaymentToMarkConverter();
                var mark = converter.Convert(SelectedItem.Payment, typeof(object), null, new System.Globalization.CultureInfo(1033));
                if (mark != null)
                {
                    ClipboardUtil.SetText(mark.ToString());
                }
            }
            else if (id == "txid")
            {
                ClipboardUtil.SetText(SelectedItem.Payment.TxId);
            }
        }
Beispiel #2
0
        private void OnCommand(string msg)
        {
            PayUrlPageMode mode;

            if (!Enum.TryParse(msg, out mode))
            {
                return;
            }

            switch (mode)
            {
            case PayUrlPageMode.CreateUrl:
                OnCreate();
                break;

            case PayUrlPageMode.CopyAddress:
                if (SelectedItem != null)
                {
                    ClipboardUtil.SetText(SelectedItem.Address);
                }
                break;

            case PayUrlPageMode.CopyLabel:
                if (SelectedItem == null)
                {
                    return;
                }
                if (string.IsNullOrEmpty(SelectedItem.Tag))
                {
                    ShowMessage(LanguageService.Default.GetLanguageValue("Error_EmptyTag"));
                }
                else
                {
                    ClipboardUtil.SetText(SelectedItem.Tag);
                }
                break;

            case PayUrlPageMode.Delete:
                OnDelete();
                break;

            case PayUrlPageMode.Edit:
                OnEdit();
                break;

            case PayUrlPageMode.Choose:
                OnChoose();
                break;

            case PayUrlPageMode.Export:
                OnExport();
                break;

            default:
                break;
            }
        }
Beispiel #3
0
        public static void KillLine(TextBox textBox)
        {
            var index = textBox.SelectionStart;

            if (index < textBox.Text.Length)
            {
                var text = textBox.Text.Substring(index);
                ClipboardUtil.SetText(text);
                textBox.Text           = textBox.Text.Remove(index);
                textBox.SelectionStart = index;
            }
        }
Beispiel #4
0
 void OnCopyURL()
 {
     ClipboardUtil.SetText(QrCodeStr);
 }
Beispiel #5
0
 void OnCopyAccount()
 {
     ClipboardUtil.SetText(PayRequest.AccountId);
 }
Beispiel #6
0
 void OnCopyAddress()
 {
     ClipboardUtil.SetText(Address);
 }