예제 #1
0
파일: Reddit.cs 프로젝트: gwely/Reddit
 /// <summary>
 /// gets logged in user's info
 /// </summary>
 /// <returns>API.Me object</returns>
 private Me GetMe()
 {
     if (!LoggedIn()) throw new NotLoggedInException("You need to be logged in to get your info");
     var Response = Connection.Get("api/me.json");
     this.Me = Me.Create(Response);
     return this.Me;
 }
예제 #2
0
파일: Me.cs 프로젝트: gwely/Reddit
        internal static Me Create(JObject Json)
        {
            var Temp = new Me();

            Temp.ID = Json["id"].StringValue;
            Temp.ModHash = Json["modhash"].StringValue;
            Temp.Name = Json["name"].StringValue;

            Temp.HasMail = Json["has_mail"].BooleanValue;
            Temp.HasModMail = Json["has_mod_mail"].BooleanValue;

            Temp.Created = Json["created"].DoubleValue.ToDateTime();
            Temp.CreatedUTC = Json["created_utc"].DoubleValue.ToDateTime();

            Temp.LinkKarma = Json["link_karma"].LongValue;
            Temp.CommentKarma = Json["comment_karma"].LongValue;

            Temp.IsGold = Json["is_gold"].BooleanValue;
            Temp.IsMod = Json["is_mod"].BooleanValue;

            return Temp;
        }