Esempio n. 1
0
        private void mintTokensMenuItem_Click(object sender, EventArgs e)
        {
            InvocationTransaction mintTransaction;

            using (MintTokensDialog dialog = new MintTokensDialog()) {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                mintTransaction = dialog.GetMintTransaction();
            }
            if (mintTransaction == null)
            {
                return;
            }
            Transaction contractTransaction;

            using (InvokeContractDialog dialog = new InvokeContractDialog(mintTransaction))
            {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                contractTransaction = dialog.GetTransaction();
            }
            if (contractTransaction == null)
            {
                return;
            }
            Helper.SignAndShowInformation(contractTransaction);
        }
Esempio n. 2
0
        private void deployContractToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InvocationTransaction tx;

            try
            {
                using (DeployContractDialog dialog = new DeployContractDialog())
                {
                    if (dialog.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    tx = dialog.GetTransaction();
                }
                using (InvokeContractDialog dialog = new InvokeContractDialog(tx))
                {
                    if (dialog.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    tx = dialog.GetTransaction(Fixed8.Zero);
                    Helper.SignAndShowInformation(tx);
                }
            }
            catch
            {
                return;
            }
        }
Esempio n. 3
0
        private void 转账TToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Transaction tx;
            UInt160     change_address;
            Fixed8      fee;

            using (TransferDialog dialog = new TransferDialog())
            {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                tx             = dialog.GetTransaction();
                change_address = dialog.ChangeAddress;
                fee            = dialog.Fee;
            }
            if (tx is InvocationTransaction itx)
            {
                using (InvokeContractDialog dialog = new InvokeContractDialog(itx))
                {
                    if (dialog.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    tx = dialog.GetTransaction(fee, change_address);
                }
            }
            Helper.SignAndShowInformation(tx);
        }
Esempio n. 4
0
        private void 转账TToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Transaction tx;

            using (TransferDialog dialog = new TransferDialog())
            {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                tx = dialog.GetTransaction();
            }
            if (tx is InvocationTransaction itx)
            {
                using (InvokeContractDialog dialog = new InvokeContractDialog(itx))
                {
                    if (dialog.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    tx = dialog.GetTransaction();
                }
            }
            Helper.SignAndShowInformation(tx);
        }
Esempio n. 5
0
 private void invokeContractToolStripMenuItem_Click(object sender, EventArgs e)
 {
     using (InvokeContractDialog dialog = new InvokeContractDialog())
     {
         if (dialog.ShowDialog() != DialogResult.OK)
         {
             return;
         }
         Helper.SignAndShowInformation(dialog.GetTransaction());
     }
 }
Esempio n. 6
0
        private void  举EToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InvocationTransaction tx;

            using (ElectionDialog dialog = new ElectionDialog())
            {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                tx = dialog.GetTransaction();
            }
            using (InvokeContractDialog dialog = new InvokeContractDialog(tx))
            {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                tx = dialog.GetTransaction();
            }
            Helper.SignAndShowInformation(tx);
        }
Esempio n. 7
0
        private void voteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            InvocationTransaction tx;
            Contract contract = (Contract)listView1.SelectedItems[0].Tag;

            using (VotingDialog dialog = new VotingDialog(contract.ScriptHash))
            {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                tx = dialog.GetTransaction();
            }
            using (InvokeContractDialog dialog = new InvokeContractDialog(tx))
            {
                if (dialog.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                tx = dialog.GetTransaction();
            }
            Helper.SignAndShowInformation(tx);
        }