Skip to content

Commit

Permalink
Add tracking token to docs links
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Jun 28, 2021
1 parent 52cd93b commit 6806376
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion MarkMpn.Sql4Cds/SettingsForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,28 @@ protected override void OnClosing(CancelEventArgs e)

private void helpIcon_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start((string) ((Control)sender).Tag);
var url = (string)((Control)sender).Tag;
const string token = "WT.mc_id=DX-MVP-5004203";

var anchor = url.IndexOf('#');
var query = url.IndexOf('?');

if (anchor == -1)
{
if (query == -1)
url += "?" + token;
else
url += "&" + token;
}
else
{
if (query == -1)
url = url.Insert(anchor, "?" + token);
else
url = url.Insert(anchor, "&" + token);
}

System.Diagnostics.Process.Start(url);
}
}
}

0 comments on commit 6806376

Please sign in to comment.