Ejemplo n.º 1
0
        public WikiPageSettings GetPageSettings(string name)
        {
            var request  = WebAgent.CreateGet(string.Format(WikiPageSettingsUrl, Subreddit.Name, name));
            var response = request.GetResponse();
            var json     = JObject.Parse(WebAgent.GetResponseString(response.GetResponseStream()));
            var result   = new WikiPageSettings(Reddit, json["data"], WebAgent);

            return(result);
        }
Ejemplo n.º 2
0
        public void SetPageSettings(string name, WikiPageSettings settings)
        {
            var request = WebAgent.CreatePost(string.Format(WikiPageSettingsUrl, Subreddit.Name, name));

            WebAgent.WritePostBody(request.GetRequestStream(), new
            {
                page      = name,
                permlevel = settings.PermLevel,
                listed    = settings.Listed,
                uh        = Reddit.User.Modhash
            });
            var response = request.GetResponse();
        }