private void Timer2_Tick(object sender, EventArgs e)
        {
            uint currentMonitordBlockHeight = 0;

            currentMonitordBlockHeight      = channel.TryGetBlockHeight(FormStartTrinity.getChannelUri());
            this.toolStripStatusLabel1.Text = String.Format("{0} : {1}", Strings.monitorBlock, currentMonitordBlockHeight.ToString());
        }
 private void PaymentCodeButton_Click(object sender, EventArgs e)
 {
     textBox1.Clear();
     try
     {
         textBox1.Text = Payment.GeneratePaymentCode(FormStartTrinity.getChannelUri(),
                                                     comboBox1.SelectedItem.ToString(),
                                                     textBox2.Text,
                                                     "payment");
     }
     catch (Exception ex)
     {
         textBox1.Text = null;
         MessageBox.Show(ex.Message);
     }
 }
        private void Form_main_Load(object sender, EventArgs e)
        {
            channel = new Channel(null, null, FormStartTrinity.getChannelUri(), null);

            getChannelList();
            //menuStrip = new ContextMenuStrip();//1
            //menuStrip.Items.Add("item1");//2
            //menuStrip.Items.Add("item2"); //3

            this.All.Click      += new System.EventHandler(this.ToolStripMenuItem_Click);
            this.Opened.Click   += new System.EventHandler(this.ToolStripMenuItem_Click);
            this.Opening.Click  += new System.EventHandler(this.ToolStripMenuItem_Click);
            this.Settled.Click  += new System.EventHandler(this.ToolStripMenuItem_Click);
            this.Settling.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
            SetAssetTypeItems();

            Control.CheckForIllegalCrossThreadCalls = false;
        }
 private void ChannelListListView_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         ListView.SelectedListViewItemCollection channelInfo = this.ChannelListListView.SelectedItems;
         foreach (ListViewItem item in channelInfo)
         {
             founderUritextBox.Text = FormStartTrinity.getChannelUri();
             peerUritextBox.Text    = item.SubItems[3].Text;
             comboBox2.Text         = item.SubItems[4].Text;
             transferChannelName    = item.SubItems[0].Text;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
         return;
     }
 }
        private void SettleChannelButton_Click(object sender, EventArgs e)
        {
            if (this.ChannelListListView.SelectedItems.Count > 0)
            {
                try
                {
                    ListView.SelectedListViewItemCollection channelInfo = this.ChannelListListView.SelectedItems;
                    ChannelTableContent deleteChannel = new ChannelTableContent();
                    foreach (ListViewItem item in channelInfo)
                    {
                        deleteChannel.channel = item.SubItems[0].Text;
                        deleteChannel.uri     = FormStartTrinity.getChannelUri();
                        deleteChannel.peer    = item.SubItems[3].Text;
                        deleteChannel.asset   = item.SubItems[4].Text;

                        deleteChannel.balance     = Fixed8.Parse(item.SubItems[1].Text).GetData();
                        deleteChannel.peerBalance = Fixed8.Parse(item.SubItems[2].Text).GetData();
                    }

                    using (FormCloseChannel formClose = new FormCloseChannel(deleteChannel))
                    {
                        if (formClose.ShowDialog() == DialogResult.OK)
                        {
                            getChannelList();
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            else
            {
                MessageBox.Show(Strings.choiceDeleteChannel);
            }
        }
Beispiel #6
0
 private void Form_create_Load(object sender, EventArgs e)
 {
     this.textBox2.Text = FormStartTrinity.getChannelUri();
 }
        /// <summary>
        /// 插件菜单按钮点击事件
        /// 如不含点击事件,则为空
        /// </summary>
        public void MenuClick()
        {
            var formStart = new FormStartTrinity();

            formStart.ShowDialog();
        }