Skip to content

Commit

Permalink
Using ConnectionDetail.OpenUrlWithBrowserProfile(Uri uri);
Browse files Browse the repository at this point in the history
  • Loading branch information
rappen committed Apr 22, 2022
1 parent 5c6ed7a commit 7f3e8e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 5 additions & 3 deletions FetchXmlBuilder/DockControls/ResultGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ private void crmGridView1_RecordDoubleClick(object sender, Rappen.XTB.Helpers.Co
if (e.Value is EntityReference entref && form.ConnectionDetail.GetEntityReferenceUrl(entref) is string urlref && !string.IsNullOrEmpty(urlref))
{
form.LogUse("OpenParentRecord");
Process.Start(urlref);
form.OpenURLProfile(urlref, false);
}
else if (e.Entity != null && form.ConnectionDetail.GetEntityUrl(e.Entity) is string urlentity && !string.IsNullOrEmpty(urlentity))
{
form.LogUse("OpenRecord");
Process.Start(urlentity);
form.OpenURLProfile(urlentity, false);
}
}

Expand Down Expand Up @@ -200,14 +200,16 @@ private void ctxOpen_Click(object sender, EventArgs e)
{
if (sender is ToolStripItem tool && tool.Tag is string url && !string.IsNullOrWhiteSpace(url))
{
Process.Start(url);
form.LogUse("OpenRecord");
form.OpenURLProfile(url, false);
}
}

private void ctxCopy_Click(object sender, EventArgs e)
{
if (sender is ToolStripItem tool && tool.Tag is string url && !string.IsNullOrWhiteSpace(url))
{
form.LogUse("CopyRecord");
Clipboard.SetText(url);
}
}
Expand Down
9 changes: 9 additions & 0 deletions FetchXmlBuilder/FetchXmlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,15 @@ internal static void HelpClick(object sender)
}
}

internal void OpenURLProfile(string url, bool addparameters)
{
if (addparameters)
{
url = Utils.ProcessURL(url);
}
ConnectionDetail.OpenUrlWithBrowserProfile(new Uri(url));
}

internal static void OpenURL(string url)
{
url = Utils.ProcessURL(url);
Expand Down

0 comments on commit 7f3e8e1

Please sign in to comment.