Skip to content

Commit ccce16c

Browse files
committed
Removed deprecated JsonObject and XmlObject helper classes
1 parent 7940c9e commit ccce16c

3 files changed

Lines changed: 30 additions & 252 deletions

File tree

src/Libraries/SmartStore.Core/SmartStore.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@
448448
<Compile Include="Utilities\DateTimeConvert.cs" />
449449
<Compile Include="Utilities\DictionaryConverter.cs" />
450450
<Compile Include="Utilities\Inflector.cs" />
451-
<Compile Include="Utilities\JsonObject.cs" />
451+
<Compile Include="Utilities\JsonExtensions.cs" />
452452
<Compile Include="Utilities\Prettifier.cs" />
453453
<Compile Include="Utilities\Range.cs" />
454454
<Compile Include="Utilities\StringTokenizer.cs" />
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using System;
2+
using System.Net;
3+
using System.Threading.Tasks;
4+
using Newtonsoft.Json;
5+
6+
7+
///////////////////////////////////////////////////////////////////////
8+
// Needs JSon.Net (Newtonsoft.Json.dll) from http://json.codeplex.com/
9+
//////////////////////////////////////////////////////////////////////
10+
11+
namespace SmartStore.Core.Utilities
12+
{
13+
public static class JsonExtensions
14+
{
15+
public static async Task<dynamic> GetDynamicJsonObject(this Uri uri)
16+
{
17+
using (WebClient wc = new WebClient())
18+
{
19+
wc.Encoding = System.Text.Encoding.UTF8;
20+
wc.Headers["User-Agent"] = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)";
21+
var response = await wc.DownloadStringTaskAsync(uri);
22+
return JsonConvert.DeserializeObjectAsync(response);
23+
}
24+
}
25+
}
26+
}
27+
28+
29+

src/Libraries/SmartStore.Core/Utilities/JsonObject.cs

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)