Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Commit

Permalink
Update MainForm.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Dec 3, 2019
1 parent 110e730 commit 86538ac
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions neo-gui/GUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ private void Blockchain_PersistCompleted(Blockchain.PersistCompleted e)
BeginInvoke(new Action(RefreshConfirmations));
}

private static void OpenBrowser(string url)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}"));
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Process.Start("xdg-open", url);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", url);
}
}

private void Service_WalletChanged(object sender, EventArgs e)
{
listView3.Items.Clear();
Expand Down Expand Up @@ -365,22 +381,6 @@ private void 官网WToolStripMenuItem_Click(object sender, EventArgs e)
OpenBrowser("https://neo.org/");
}

public static void OpenBrowser(string url)
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
Process.Start(new ProcessStartInfo("cmd", $"/c start {url}"));
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
Process.Start("xdg-open", url);
}
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{
Process.Start("open", url);
}
}

private void 开发人员工具TToolStripMenuItem_Click(object sender, EventArgs e)
{
Helper.Show<DeveloperToolsForm>();
Expand Down Expand Up @@ -570,19 +570,19 @@ private void toolStripMenuItem1_Click(object sender, EventArgs e)
private void listView1_DoubleClick(object sender, EventArgs e)
{
if (listView1.SelectedIndices.Count == 0) return;
Process.Start($"https://neoscan.io/address/{listView1.SelectedItems[0].Text}");
OpenBrowser($"https://neoscan.io/address/{listView1.SelectedItems[0].Text}");
}

private void listView2_DoubleClick(object sender, EventArgs e)
{
if (listView2.SelectedIndices.Count == 0) return;
Process.Start($"https://neoscan.io/asset/{listView2.SelectedItems[0].Name[2..]}");
OpenBrowser($"https://neoscan.io/asset/{listView2.SelectedItems[0].Name[2..]}");
}

private void listView3_DoubleClick(object sender, EventArgs e)
{
if (listView3.SelectedIndices.Count == 0) return;
Process.Start($"https://neoscan.io/transaction/{listView3.SelectedItems[0].Name[2..]}");
OpenBrowser($"https://neoscan.io/transaction/{listView3.SelectedItems[0].Name[2..]}");
}

private void toolStripStatusLabel3_Click(object sender, EventArgs e)
Expand Down

0 comments on commit 86538ac

Please sign in to comment.