Skip to content

Commit

Permalink
Simplifying link opening
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Apr 3, 2024
1 parent f1a28f6 commit 6dbdba8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
6 changes: 6 additions & 0 deletions FetchXmlBuilder/FXBGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,18 @@ internal void ShowMetadata(MetadataBase meta)
}
}

internal void HelpClick(object sender, EventArgs e) => HelpClick(sender);

internal static void HelpClick(object sender)
{
if (sender is Control control && control.Tag is string tag)
{
HelpClick(tag);
}
else if (sender is ToolStripItem tsi && tsi.Tag is string tsitag)
{
HelpClick(tsitag);
}
}

internal static void HelpClick(string url)
Expand Down
4 changes: 2 additions & 2 deletions FetchXmlBuilder/FetchXmlBuilder.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions FetchXmlBuilder/FetchXmlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -878,18 +878,6 @@ private void tsbShare_Click(object sender, EventArgs e)
ShareLink.Open(this, dockControlBuilder.GetFetchString(false, false));
}

private void LinkButton_Click(object sender, EventArgs e)
{
if (sender is ToolStripItem tsi && tsi.Tag is string tag1 && tag1.StartsWith("http") == true)
{
OpenURL(tag1);
}
else if (sender is Control control && control.Tag is string tag2 && tag2.StartsWith("http") == true)
{
OpenURL(tag2);
}
}

#endregion Private Event Handlers
}
}

0 comments on commit 6dbdba8

Please sign in to comment.