Inheritance: BaseTreeNode
Exemplo n.º 1
0
        public static void ExpandConnectionProperties(ConnectionNode connectionNode)
        {
            var accounts = BlockStudioProjectService.BlockStudioProject.Accounts;

            connectionNode.Nodes[0].Nodes.Clear();

            foreach (var account in accounts)
            {
                var accountNode = new AccountNode();

                accountNode.Text = account.Label;

                if (account.LockState == LockedState.Locked)
                {
                    accountNode.ImageIndex         = 3;
                    accountNode.SelectedImageIndex = 3;
                }
                else if (account.LockState == LockedState.Unlocked)
                {
                    accountNode.ImageIndex         = 4;
                    accountNode.SelectedImageIndex = 4;
                }
                else if (account.LockState == LockedState.WrongPassword)
                {
                    accountNode.ImageIndex         = 6;
                    accountNode.SelectedImageIndex = 6;
                }

                accountNode.Account = account;
                accountNode.Name    = NodeType.Account.ToString();

                var addressNode = new AddressNode(account.Address);
                var balanceNode = new BalanceNode(string.Format("Balance: {0} Eth", account.BalanceEther));
                accountNode.Nodes.Add(addressNode);
                accountNode.Nodes.Add(balanceNode);

                connectionNode.Nodes[0].Nodes.Add(accountNode);
            }
        }
        public static void ExpandConnectionProperties(ConnectionNode connectionNode)
        {
            var accounts = BlockStudioProjectService.BlockStudioProject.Accounts;
            connectionNode.Nodes[0].Nodes.Clear();

            foreach (var account in accounts)
            {
                var accountNode = new AccountNode();

                accountNode.Text = account.Label;

                if (account.LockState == LockedState.Locked)
                {
                    accountNode.ImageIndex = 3;
                    accountNode.SelectedImageIndex = 3;
                }
                else if (account.LockState == LockedState.Unlocked)
                {
                    accountNode.ImageIndex = 4;
                    accountNode.SelectedImageIndex = 4;
                }
                else if (account.LockState == LockedState.WrongPassword)
                {
                    accountNode.ImageIndex = 6;
                    accountNode.SelectedImageIndex = 6;
                }

                accountNode.Account = account;
                accountNode.Name = NodeType.Account.ToString();

                var addressNode = new AddressNode(account.Address);
                var balanceNode = new BalanceNode(string.Format("Balance: {0} Eth", account.BalanceEther));
                accountNode.Nodes.Add(addressNode);
                accountNode.Nodes.Add(balanceNode);

                connectionNode.Nodes[0].Nodes.Add(accountNode);
            }
        }