Added a url utility
This commit is contained in:
parent
999bad8230
commit
efcf5bebdc
2 changed files with 3 additions and 15 deletions
|
|
@ -561,18 +561,6 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public static void LaunchBrowser(string targetUri)
|
||||
{
|
||||
string AddQueryPram(string url, string key, string value)
|
||||
{
|
||||
if (url.Contains("?"))
|
||||
{
|
||||
return url + "&" + key + "=" + value;
|
||||
}
|
||||
else
|
||||
{
|
||||
return url + "?" + key + "=" + value;
|
||||
}
|
||||
}
|
||||
|
||||
UiThread.RunOnIdle(() =>
|
||||
{
|
||||
var affiliateCode = OemSettings.Instance.AffiliateCode;
|
||||
|
|
@ -591,11 +579,11 @@ namespace MatterHackers.MatterControl
|
|||
// if the affiliateCode is only numbers, we assume it is a tracking code
|
||||
if (affiliateCode.All(char.IsDigit))
|
||||
{
|
||||
targetUri = AddQueryPram(targetUri, "aff", affiliateCode);
|
||||
targetUri = Util.AddQueryPram(targetUri, "aff", affiliateCode);
|
||||
}
|
||||
else // it is an RCODE
|
||||
{
|
||||
targetUri = AddQueryPram(targetUri, "rcode", affiliateCode);
|
||||
targetUri = Util.AddQueryPram(targetUri, "rcode", affiliateCode);
|
||||
}
|
||||
|
||||
targetUri += internalLink;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue