-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from etishor/master
Update of newtonsoft json to latest version. Date property added to Article class.
- Loading branch information
Showing
43 changed files
with
35,373 additions
and
39,847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
obj | ||
bin | ||
*.user | ||
*.suo | ||
*.orig | ||
*.docstates | ||
output | ||
publish | ||
_ReSharper.* | ||
*.Resharper | ||
*.Cache | ||
*.cache | ||
~$* |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,123 +1,131 @@ | ||
// JSON C# Class Generator | ||
// http://at-my-window.blogspot.com/?page=json-class-generator | ||
|
||
using System; | ||
using Newtonsoft.Json.Linq; | ||
using JsonCSharpClassGenerator; | ||
using DiffbotApi.JsonTypes; | ||
|
||
namespace DiffbotApi | ||
{ | ||
|
||
public class Article | ||
{ | ||
|
||
public Article(string json) | ||
: this(JObject.Parse(json)) | ||
{ | ||
} | ||
|
||
private JObject __jobject; | ||
public Article(JObject obj) | ||
{ | ||
this.__jobject = obj; | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private string[] _tags; | ||
public string[] Tags | ||
{ | ||
get | ||
{ | ||
if(_tags == null) | ||
_tags = (string[])JsonClassHelper.ReadArray<string>(JsonClassHelper.GetJToken<JArray>(__jobject, "tags"), JsonClassHelper.ReadString, typeof(string[])); | ||
return _tags; | ||
} | ||
} | ||
|
||
public string Summary | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "summary")); | ||
} | ||
} | ||
|
||
public string Author | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "author")); | ||
} | ||
} | ||
|
||
public string Text | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "text")); | ||
} | ||
} | ||
|
||
public string Title | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "title")); | ||
} | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private Stats _stats; | ||
public Stats Stats | ||
{ | ||
get | ||
{ | ||
if(_stats == null) | ||
_stats = JsonClassHelper.ReadStronglyTypedObject<Stats>(JsonClassHelper.GetJToken<JObject>(__jobject, "stats")); | ||
return _stats; | ||
} | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private Medium[] _media; | ||
public Medium[] Media | ||
{ | ||
get | ||
{ | ||
if(_media == null) | ||
_media = (Medium[])JsonClassHelper.ReadArray<Medium>(JsonClassHelper.GetJToken<JArray>(__jobject, "media"), JsonClassHelper.ReadStronglyTypedObject<Medium>, typeof(Medium[])); | ||
return _media; | ||
} | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private Comments _comments; | ||
public Comments Comments | ||
{ | ||
get | ||
{ | ||
if(_comments == null) | ||
_comments = JsonClassHelper.ReadStronglyTypedObject<Comments>(JsonClassHelper.GetJToken<JObject>(__jobject, "comments")); | ||
return _comments; | ||
} | ||
} | ||
|
||
public string Url | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "url")); | ||
} | ||
} | ||
|
||
public string Xpath | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "xpath")); | ||
} | ||
} | ||
|
||
} | ||
} | ||
// JSON C# Class Generator | ||
// http://at-my-window.blogspot.com/?page=json-class-generator | ||
|
||
using System; | ||
using DiffbotApi.JsonTypes; | ||
using JsonCSharpClassGenerator; | ||
using Newtonsoft.Json.Linq; | ||
|
||
namespace DiffbotApi | ||
{ | ||
|
||
public class Article | ||
{ | ||
|
||
public Article(string json) | ||
: this(JObject.Parse(json)) | ||
{ | ||
} | ||
|
||
private JObject __jobject; | ||
public Article(JObject obj) | ||
{ | ||
this.__jobject = obj; | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private string[] _tags; | ||
public string[] Tags | ||
{ | ||
get | ||
{ | ||
if (_tags == null) | ||
_tags = (string[])JsonClassHelper.ReadArray<string>(JsonClassHelper.GetJToken<JArray>(__jobject, "tags"), JsonClassHelper.ReadString, typeof(string[])); | ||
return _tags; | ||
} | ||
} | ||
|
||
public string Summary | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "summary")); | ||
} | ||
} | ||
|
||
public string Author | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "author")); | ||
} | ||
} | ||
|
||
public string Text | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "text")); | ||
} | ||
} | ||
|
||
public string Title | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "title")); | ||
} | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private Stats _stats; | ||
public Stats Stats | ||
{ | ||
get | ||
{ | ||
if (_stats == null) | ||
_stats = JsonClassHelper.ReadStronglyTypedObject<Stats>(JsonClassHelper.GetJToken<JObject>(__jobject, "stats")); | ||
return _stats; | ||
} | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private Medium[] _media; | ||
public Medium[] Media | ||
{ | ||
get | ||
{ | ||
if (_media == null) | ||
_media = (Medium[])JsonClassHelper.ReadArray<Medium>(JsonClassHelper.GetJToken<JArray>(__jobject, "media"), JsonClassHelper.ReadStronglyTypedObject<Medium>, typeof(Medium[])); | ||
return _media; | ||
} | ||
} | ||
|
||
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)] | ||
private Comments _comments; | ||
public Comments Comments | ||
{ | ||
get | ||
{ | ||
if (_comments == null) | ||
_comments = JsonClassHelper.ReadStronglyTypedObject<Comments>(JsonClassHelper.GetJToken<JObject>(__jobject, "comments")); | ||
return _comments; | ||
} | ||
} | ||
|
||
public string Url | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "url")); | ||
} | ||
} | ||
|
||
public string Xpath | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "xpath")); | ||
} | ||
} | ||
|
||
public DateTime? Date | ||
{ | ||
get | ||
{ | ||
return JsonClassHelper.ReadNullableDate(JsonClassHelper.GetJToken<JValue>(__jobject, "date")); | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.