Beispiel #1
0
        private void QRCodeItem(object sender, RoutedEventArgs e)
        {
            var account = (Account)AccountsListBox.SelectedItem;

            if (account == null)
            {
                return;
            }
            var uri = $"otpauth://totp/{account.Email}?secret={account.SharedSecret}&issuer={account.Issuer}&=algorithm={account.HMACAlgorithm}&digits={account.Digits}&period={account.Period}";

            var writer = new BarcodeWriterGeometry
            {
                Format  = BarcodeFormat.QR_CODE,
                Options = new EncodingOptions
                {
                    Height = 200,
                    Width  = 200,
                    Margin = 0
                }
            };
            var image  = writer.Write(uri);
            var window = new QRWindow(image, account.Email)
            {
                Owner = this
            };

            window.ShowDialog();
        }
Beispiel #2
0
        public DonationView()
        {
            InitializeComponent();

            var writer = new BarcodeWriterGeometry
            {
                Format  = BarcodeFormat.QR_CODE,
                Options = new EncodingOptions {
                    Height = (int)bitcoinQRCode.Height, Width = (int)bitcoinQRCode.Width, Margin = 0
                }
            };

            bitcoinQRCode.Data = writer.Write("1DppXkNfPKbs1JiF2vZ3m89QQKnToPAuMZ");
        }