Exemplo n.º 1
0
        /// <summary>
        /// Create a new instance of the subreddit posts controller.
        /// </summary>
        /// <param name="dispatch"></param>
        /// <param name="subreddit">The name of the subreddit</param>
        /// <param name="best"></param>
        /// <param name="hot"></param>
        /// <param name="newPosts"></param>
        /// <param name="rising"></param>
        /// <param name="top"></param>
        /// <param name="controversial"></param>
        /// <param name="modQueue"></param>
        /// <param name="modQueueReports"></param>
        /// <param name="modQueueSpam"></param>
        /// <param name="modQueueUnmoderated"></param>
        /// <param name="modQueueEdited"></param>
        public SubredditPosts(Dispatch dispatch, string subreddit, List <Post> best = null, List <Post> hot = null, List <Post> newPosts = null,
                              List <Post> rising          = null, List <Post> top = null, List <Post> controversial = null, List <Post> modQueue = null,
                              List <Post> modQueueReports = null, List <Post> modQueueSpam = null, List <Post> modQueueUnmoderated = null,
                              List <Post> modQueueEdited  = null)
            : base()
        {
            Dispatch  = dispatch;
            Subreddit = subreddit;

            Best          = best ?? new List <Post>();
            Hot           = hot ?? new List <Post>();
            New           = newPosts ?? new List <Post>();
            Rising        = rising ?? new List <Post>();
            Top           = top ?? new List <Post>();
            Controversial = controversial ?? new List <Post>();

            ModQueue            = modQueue ?? new List <Post>();
            ModQueueReports     = modQueueReports ?? new List <Post>();
            ModQueueSpam        = modQueueSpam ?? new List <Post>();
            ModQueueUnmoderated = modQueueUnmoderated ?? new List <Post>();
            ModQueueEdited      = modQueueEdited ?? new List <Post>();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new Account instance.  Note that this is already taken care of in the main class.
 /// </summary>
 /// <param name="dispatch"></param>
 public Account(Dispatch dispatch)
 {
     Dispatch = dispatch;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create an empty link post controller instance.
 /// </summary>
 /// <param name="dispatch"></param>
 public LinkPost(Dispatch dispatch) : base(dispatch)
 {
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new link post controller instance, populated only with its fullname and subreddit.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="fullname">Fullname of the post</param>
 /// <param name="subreddit">A valid subreddit instance</param>
 public LinkPost(Dispatch dispatch, string fullname, string subreddit) : base(dispatch, fullname, subreddit)
 {
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new comment controller instance from API return data.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="listing"></param>
 public Comment(Dispatch dispatch, Things.Comment listing)
 {
     Dispatch = dispatch;
     Import(listing);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Create new SelfPost instance from Reddit API listing.
 /// </summary>
 /// <param name="dispatch">An instance of the Dispatch controller</param>
 /// <param name="listing">Listing returned by Reddit API.</param>
 public SelfPost(Dispatch dispatch, Things.Post listing) : base(dispatch, listing)
 {
     SelfText     = listing.SelfText;
     SelfTextHTML = listing.SelfTextHTML;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Create a new self post controller instance, populated from LinkPost data.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="linkPost"></param>
 public SelfPost(Dispatch dispatch, LinkPost linkPost)
     : base(dispatch, linkPost.Subreddit, linkPost.Title, linkPost.Author, nsfw: linkPost.NSFW)
 {
     Listing = new Things.Post(this);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Create a new live thread controller instance from another live thread controller instance.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="liveThread">A valid instance of this class</param>
 public LiveThread(Dispatch dispatch, LiveThread liveThread)
 {
     Dispatch = dispatch;
     Import(liveThread.EventData);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Create a new live thread controller instance populated with only its id.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="id">A valid live thread ID</param>
 public LiveThread(Dispatch dispatch, string id)
 {
     Dispatch = dispatch;
     Id       = id;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Create a new instance of the wiki controller.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="subreddit">The name of the subreddit to which this wiki belongs</param>
 public Wiki(Dispatch dispatch, string subreddit)
 {
     Dispatch  = dispatch;
     Subreddit = subreddit;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Create a new comment controller instance, populated only with its fullname.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="fullname">Fullname of the comment</param>
 public Comment(Dispatch dispatch, string fullname)
 {
     Dispatch = dispatch;
     Fullname = fullname;
 }
Exemplo n.º 12
0
 /// <summary>
 /// Create an empty wiki page controller instance.
 /// </summary>
 /// <param name="dispatch"></param>
 public WikiPage(Dispatch dispatch)
 {
 }
Exemplo n.º 13
0
 /// <summary>
 /// Create a new wiki page controller instance, populated only with subreddit and name.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="subreddit"></param>
 /// <param name="name"></param>
 public WikiPage(Dispatch dispatch, string subreddit = null, string name = null)
 {
     Dispatch  = dispatch;
     Subreddit = subreddit;
     Name      = name;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Create a new link post controller instance from API return data.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="listing"></param>
 public LinkPost(Dispatch dispatch, Things.Post listing) : base(dispatch, listing)
 {
 }
Exemplo n.º 15
0
 /// <summary>
 /// Creates a new Account instance.  Note that this is already taken care of in the main class.
 /// </summary>
 /// <param name="dispatch"></param>
 public Account(Dispatch dispatch)
 {
     Dispatch = dispatch;
     Messages = new PrivateMessages(Dispatch);
     Modmail  = new Modmail(Dispatch);
 }
Exemplo n.º 16
0
 /// <summary>
 /// Create an empty post controller instance.
 /// </summary>
 /// <param name="dispatch"></param>
 public Post(Dispatch dispatch)
 {
     Dispatch = dispatch;
 }
Exemplo n.º 17
0
 /// <summary>
 /// Create a new post controller instance from API return data.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="listing"></param>
 public Post(Dispatch dispatch, Things.Post listing)
 {
     Dispatch = dispatch;
     Import(listing);
 }
Exemplo n.º 18
0
 /// <summary>
 /// Create a new instance of the flairs controller.
 /// </summary>
 /// <param name="subreddit">The name of the subreddit with the flairs</param>
 /// <param name="dispatch"></param>
 public Flairs(Dispatch dispatch, string subreddit) : base()
 {
     Dispatch  = dispatch;
     Subreddit = subreddit;
 }
Exemplo n.º 19
0
 /// <summary>
 /// Create a new live thread controller instance from API return data.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="liveUpdateEvent"></param>
 public LiveThread(Dispatch dispatch, LiveUpdateEvent liveUpdateEvent)
 {
     Dispatch = dispatch;
     Import(liveUpdateEvent);
 }
Exemplo n.º 20
0
 /// <summary>
 /// Create an empty user controller instance.
 /// </summary>
 /// <param name="dispatch"></param>
 public User(Dispatch dispatch)
 {
     Dispatch = dispatch;
 }
Exemplo n.º 21
0
 /// <summary>
 /// Create an empty SelfPost instance.
 /// </summary>
 /// <param name="dispatch">An instance of the Dispatch controller</param>
 public SelfPost(Dispatch dispatch) : base(dispatch)
 {
 }
Exemplo n.º 22
0
 /// <summary>
 /// Create a new user controller instance from API return data.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="user"></param>
 public User(Dispatch dispatch, Things.User user)
 {
     Import(user);
     Dispatch = dispatch;
 }
Exemplo n.º 23
0
 /// <summary>
 /// Create a new SelfPost instance populated only with its Fullname.
 /// Useful for About() queries (e.g. new SelfPost("t3_whatever").About() will retrieve a new SelfPost by its fullname).
 /// </summary>
 /// <param name="dispatch">An instance of the Dispatch controller</param>
 /// <param name="fullname">fullname of a thing</param>
 public SelfPost(Dispatch dispatch, string fullname) : base(dispatch, fullname)
 {
 }
Exemplo n.º 24
0
 /// <summary>
 /// Copy another user controller instance onto this one.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="user"></param>
 public User(Dispatch dispatch, User user)
 {
     Import(user);
     Dispatch = dispatch;
 }
Exemplo n.º 25
0
 /// <summary>
 /// Create an empty comment controller instance.
 /// </summary>
 /// <param name="dispatch"></param>
 public Comment(Dispatch dispatch)
 {
     Dispatch = dispatch;
 }
Exemplo n.º 26
0
 /// <summary>
 /// Create a new instance of the modmail controller.
 /// </summary>
 /// <param name="dispatch"></param>
 public Modmail(Dispatch dispatch) : base()
 {
     Dispatch = dispatch;
 }
Exemplo n.º 27
0
 /// <summary>
 /// Create a new link post controller instance, populated from SelfPost data.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="selfPost"></param>
 public LinkPost(Dispatch dispatch, SelfPost selfPost)
     : base(dispatch, selfPost.Subreddit, selfPost.Title, selfPost.Author, nsfw: selfPost.NSFW)
 {
     Listing = new Things.Post(this);
 }
Exemplo n.º 28
0
 /// <summary>
 /// Create a new post controller instance, populated with only its fullname.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="fullname">Fullname of the post</param>
 public Post(Dispatch dispatch, string fullname)
 {
     Dispatch = dispatch;
     Fullname = fullname;
 }
Exemplo n.º 29
0
 /// <summary>
 /// Create a new link post controller instance, populated only with its fullname.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="fullname">Fullname of the post</param>
 public LinkPost(Dispatch dispatch, string fullname) : base(dispatch, fullname)
 {
 }
Exemplo n.º 30
0
 /// <summary>
 /// Create a new post controller instance, populated with only its fullname and subreddit.
 /// </summary>
 /// <param name="dispatch"></param>
 /// <param name="fullname">Fullname of the post</param>
 /// <param name="subreddit">A valid subreddit name</param>
 public Post(Dispatch dispatch, string fullname, string subreddit)
 {
     Dispatch  = dispatch;
     Fullname  = fullname;
     Subreddit = subreddit;
 }