Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
Arquivo: Me.cs Projeto: 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;
        }