2021-02-21 21:52:41 -06:00
|
|
|
// Decompiled with JetBrains decompiler
|
|
|
|
|
// Type: ZuneXml.CatalogSearchQueryHelper
|
|
|
|
|
// Assembly: ZuneShell, Version=4.7.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
|
|
|
|
|
// MVID: FC8028F3-A47B-4FB4-B35B-11D1752D8264
|
|
|
|
|
// Assembly location: C:\Program Files\Zune\ZuneShell.dll
|
|
|
|
|
|
|
|
|
|
using Microsoft.Zune.Configuration;
|
|
|
|
|
using Microsoft.Zune.Shell;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace ZuneXml
|
|
|
|
|
{
|
|
|
|
|
internal class CatalogSearchQueryHelper : CatalogServiceQueryHelper
|
|
|
|
|
{
|
|
|
|
|
internal static ZuneServiceQueryHelper ConstructSearchQueryHelper(
|
|
|
|
|
ZuneServiceQuery query)
|
|
|
|
|
{
|
2021-02-21 22:59:09 -06:00
|
|
|
return new CatalogSearchQueryHelper(query);
|
2021-02-21 21:52:41 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal CatalogSearchQueryHelper(ZuneServiceQuery query)
|
|
|
|
|
: base(query)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal override string GetResourceUri()
|
|
|
|
|
{
|
|
|
|
|
string property1 = (string)this.Query.GetProperty("ResourceType");
|
|
|
|
|
string property2 = (string)this.Query.GetProperty("Keywords");
|
|
|
|
|
if (string.IsNullOrEmpty(property1) || string.IsNullOrEmpty(property2))
|
2021-02-21 22:59:09 -06:00
|
|
|
return null;
|
2022-06-23 23:08:56 -05:00
|
|
|
string endPointUri = ZuneApplication.Service2.GetEndPointUri(this._endPoint);
|
2021-02-21 21:52:41 -06:00
|
|
|
StringBuilder stringBuilder = new StringBuilder(128);
|
|
|
|
|
stringBuilder.Append(endPointUri);
|
|
|
|
|
stringBuilder.Append("/");
|
|
|
|
|
stringBuilder.Append(property1);
|
|
|
|
|
stringBuilder.Append("?q=");
|
|
|
|
|
stringBuilder.Append(Uri.EscapeDataString(property2));
|
|
|
|
|
string property3 = (string)this.Query.GetProperty("ClientType");
|
|
|
|
|
if (!string.IsNullOrEmpty(property3))
|
|
|
|
|
{
|
|
|
|
|
stringBuilder.Append("&clientType=");
|
|
|
|
|
stringBuilder.Append(property3);
|
|
|
|
|
}
|
|
|
|
|
string property4 = (string)this.Query.GetProperty("Store");
|
|
|
|
|
if (!string.IsNullOrEmpty(property4))
|
|
|
|
|
{
|
|
|
|
|
stringBuilder.Append("&store=");
|
|
|
|
|
stringBuilder.Append(property4);
|
|
|
|
|
}
|
|
|
|
|
string timeTravel = ClientConfiguration.Service.TimeTravel;
|
2022-06-06 15:08:07 -05:00
|
|
|
if (!string.IsNullOrEmpty(timeTravel) && ZuneApplication.Service2.IsSignedIn())
|
2021-02-21 21:52:41 -06:00
|
|
|
{
|
|
|
|
|
stringBuilder.Append("&instant=");
|
|
|
|
|
stringBuilder.Append(Uri.EscapeDataString(timeTravel));
|
|
|
|
|
}
|
|
|
|
|
return stringBuilder.ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|