private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex < 0)
            {
                return;
            }
            listBox2.Items.Clear();
            if (Program.CurrentWallet == null)
            {
                return;
            }
            UInt160 hash       = ((string)listBox1.SelectedItem).ToScriptHash();
            var     parameters = context.GetParameters(hash);

            if (parameters == null)
            {
                var parameterList = Program.CurrentWallet.GetAccount(hash).Contract.ParameterList ?? Blockchain.Singleton.Store.GetContracts()[hash].ParameterList;
                if (parameterList != null)
                {
                    var pList = new List <ContractParameter>();
                    for (int i = 0; i < parameterList.Length; i++)
                    {
                        pList.Add(new ContractParameter(parameterList[i]));
                        context.Add(Program.CurrentWallet.GetAccount(hash).Contract, i, null);
                    }
                }
            }
            listBox2.Items.AddRange(context.GetParameters(hash).ToArray());
            button4.Visible = context.Completed;
        }
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex < 0)
            {
                return;
            }
            listBox2.Items.Clear();
            if (Service.CurrentWallet == null)
            {
                return;
            }
            UInt160 hash       = ((string)listBox1.SelectedItem).ToScriptHash(Service.NeoSystem.Settings.AddressVersion);
            var     parameters = context.GetParameters(hash);

            if (parameters == null)
            {
                var parameterList = Service.CurrentWallet.GetAccount(hash).Contract.ParameterList;
                if (parameterList != null)
                {
                    var pList = new List <ContractParameter>();
                    for (int i = 0; i < parameterList.Length; i++)
                    {
                        pList.Add(new ContractParameter(parameterList[i]));
                        context.Add(Service.CurrentWallet.GetAccount(hash).Contract, i, null);
                    }
                }
            }
            listBox2.Items.AddRange(context.GetParameters(hash).ToArray());
            button4.Visible = context.Completed;
        }
Esempio n. 3
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex < 0)
            {
                return;
            }
            listBox2.Items.Clear();
            if (Program.CurrentWallet == null)
            {
                return;
            }
            UInt160 hash = Wallet.ToScriptHash((string)listBox1.SelectedItem);

            listBox2.Items.AddRange(context.GetParameters(hash).ToArray());
        }