private void listView_Wallets_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Right) { if (listView_Wallets.FocusedItem.Bounds.Contains(e.Location) == true) { if (listView_Wallets.SelectedObject != null) { WalletBalance item = listView_Wallets.SelectedObject as WalletBalance; ForkData fork = ForkList.FirstOrDefault(f => f.Symbol == item.Symbol && f.Name == item.CoinName); ContextMenuStrip menu = new ContextMenuStrip(); ToolStripMenuItem menuItem = new ToolStripMenuItem() { Text = "Copy Address To Clipboard " + item.Address, Image = ContentManager.GetIcon("ClipboardLoad") }; menuItem.Click += new EventHandler(CopyItem_Menu_Click); menu.Items.Add(menuItem); if (fork != null) { if (fork.Explorer.Length > 0) { ToolStripMenuItem importItem = new ToolStripMenuItem() { Text = "Check Balance For " + item.Name + "_" + item.Symbol + "_" + item.Address, Image = ContentManager.GetIcon("SearchList") }; importItem.Click += new EventHandler(CheckItem_Menu_Click); menu.Items.Add(importItem); } } menu.Items.Add(new ToolStripSeparator()); ToolStripMenuItem verifyItem = new ToolStripMenuItem() { Text = "Verify " + item.Address, Image = ContentManager.GetIcon("Unknown") }; verifyItem.Click += new EventHandler(VerifyItem_Menu_Click); menu.Items.Add(verifyItem); menu.Show(Cursor.Position); } } } }
private void CheckItem_Menu_Click(object sender, EventArgs e) { string data = sender.ToString().Replace("Check Balance For ", ""); string[] split = data.Split('_'); string name = split[0]; string symbol = split[1]; string address = split[2]; //LogManager.AddLogMessage(Name, "ImportItem_Menu_Click", "Import For : " + name + " | " + symbol + " | " + address, LogManager.LogMessageType.DEBUG); ForkData forkData = ForkList.FirstOrDefault(item => item.Symbol == symbol); if (forkData != null) { //LogManager.AddLogMessage(Name, "ImportItem_Menu_Click", forkData.Url, LogManager.LogMessageType.DEBUG); Clipboard.SetText(address); FormManager.OpenUrl(forkData.Explorer); } }