First actual commit
added sources to repository
This commit is contained in:
31
RedditSharp/WikiPageSettings.cs
Normal file
31
RedditSharp/WikiPageSettings.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using RedditSharp.Things;
|
||||
|
||||
namespace RedditSharp
|
||||
{
|
||||
public class WikiPageSettings
|
||||
{
|
||||
[JsonProperty("listed")]
|
||||
public bool Listed { get; set; }
|
||||
|
||||
[JsonProperty("permlevel")]
|
||||
public int PermLevel { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public IEnumerable<RedditUser> Editors { get; set; }
|
||||
|
||||
public WikiPageSettings()
|
||||
{
|
||||
}
|
||||
|
||||
protected internal WikiPageSettings(Reddit reddit, JToken json, IWebAgent webAgent)
|
||||
{
|
||||
var editors = json["editors"].ToArray();
|
||||
Editors = editors.Select(x => new RedditUser().Init(reddit, x, webAgent));
|
||||
JsonConvert.PopulateObject(json.ToString(), this, reddit.JsonSerializerSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user