Reddit.NET  1.5
Reddit.NET is a .NET Standard library that provides easy access to the Reddit API with virtually no boilerplate code required.
Reddit.Controllers.Wiki Class Reference

Controller class for a subreddit's wiki. More...

Inheritance diagram for Reddit.Controllers.Wiki:
Reddit.Controllers.Internal.Monitors Reddit.Controllers.BaseController Reddit.Controllers.Internal.Validators

Public Member Functions

 Wiki (Dispatch dispatch, string subreddit)
 Create a new instance of the wiki controller. More...
 
WikiPage GetPage (string pageName, string v="", string v2="")
 Return the content of an existing wiki page. If v is given, show the wiki page as it was at that version. If both v and v2 are given, show a diff of the two. More...
 
WikiPage Page (string pageName, bool mayRevise, DateTime revisionDate, string contentHtml, User revisionBy, string contentMd)
 Return a new instance of the WikiPage controller. More...
 
WikiPage Page (string pageName, Things.WikiPage wikiPage)
 Return a new instance of the WikiPage controller. More...
 
WikiPage Page (string pageName)
 Return a new instance of the WikiPage controller. More...
 
List< SubredditUserGetContributors (string after="", string before="", int limit=25, string user="", bool includeCategories=false, int count=0, string show="all", bool srDetail=false)
 Get the approved submitters of this subreddit's wiki. More...
 
List< SubredditUserGetContributors (SubredditsAboutInput subredditsAboutInput)
 Get the approved submitters of this subreddit's wiki. More...
 
List< BannedUserGetBannedUsers (string after="", string before="", int limit=25, string user="", bool includeCategories=false, int count=0, string show="all", bool srDetail=false)
 Get a list of users who were banned from this subreddit's wiki. More...
 
List< BannedUserGetBannedUsers (SubredditsAboutInput subredditsAboutInput)
 Get the approved submitters of this subreddit's wiki. More...
 
List< string > GetPages ()
 Retrieve a list of wiki pages in this subreddit. More...
 
List< Things.WikiPageRevision > GetRecentPageRevisions (int limit=25, string after="", string before="", string show="all", bool srDetail=false, int count=0)
 Retrieve a list of recently changed wiki pages in this subreddit. More...
 
List< Things.WikiPageRevision > GetRecentPageRevisions (SrListingInput srListingInput)
 Retrieve a list of recently changed wiki pages in this subreddit. More...
 
bool MonitorPages (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null, bool useCache=true)
 Monitor this wiki for added/removed pages. More...
 
bool WikiPagesIsMonitored ()
 Whether the wiki pages list is being monitored. More...
 
- Public Member Functions inherited from Reddit.Controllers.Internal.Monitors
 Monitors ()
 
void Wait (int ms)
 
bool IsMonitored (string key, string subKey)
 
bool IsScheduled ()
 
void WaitOrDie (string key, int timeout=60)
 
void WaitOrDie (Thread thread, int timeout=60)
 
void KillAllMonitoringThreads ()
 
- Public Member Functions inherited from Reddit.Controllers.BaseController
 BaseController ()
 Create a new Controller instance. More...
 
- Public Member Functions inherited from Reddit.Controllers.Internal.Validators
Exception BuildException (Exception ex, List< List< string >> errors)
 
dynamic Validate (dynamic obj)
 
GenericContainer Validate (GenericContainer genericContainer)
 
Generic Validate (Generic generic)
 
DynamicShortListingContainer Validate (DynamicShortListingContainer dynamicShortListingContainer)
 
DynamicShortListingData Validate (DynamicShortListingData dynamicShortListingData)
 
ImageUploadResult Validate (ImageUploadResult imageUploadResult)
 
LiveUpdateEventContainer Validate (LiveUpdateEventContainer liveUpdateEventContainer)
 
LiveThreadCreateResultContainer Validate (LiveThreadCreateResultContainer liveThreadCreateResultContainer)
 
LiveUpdateContainer Validate (LiveUpdateContainer liveUpdateContainer, int? minChildren=null)
 
SubredditSettingsContainer Validate (SubredditSettingsContainer subredditSettingsContainer)
 
SubredditSettings Validate (SubredditSettings subredditSettings)
 
List< ActionResultValidate (List< ActionResult > actionResults)
 
ActionResult Validate (ActionResult actionResult)
 
FlairListResultContainer Validate (FlairListResultContainer flairListResultContainer)
 
Flair Validate (Flair flair)
 
FlairV2 Validate (FlairV2 flairV2)
 
ModActionContainer Validate (ModActionContainer modActionContainer)
 
ModActionData Validate (ModActionData modActionData)
 
WikiPageRevisionContainer Validate (WikiPageRevisionContainer wikiPageRevisionContainer)
 
WikiPageRevisionData Validate (WikiPageRevisionData wikiPageRevisionData)
 
WikiPageSettingsContainer Validate (WikiPageSettingsContainer wikiPageSettingsContainer)
 
WikiPageSettings Validate (WikiPageSettings wikiPageSettings)
 
List< UserPrefsContainerValidate (List< UserPrefsContainer > userPrefsContainers)
 
UserPrefsContainer Validate (UserPrefsContainer userPrefsContainer)
 
UserPrefsData Validate (UserPrefsData userPrefsData)
 
PostResultShortContainer Validate (PostResultShortContainer postResultShortContainer)
 
PostResultShort Validate (PostResultShort postResultShort)
 
PostResultContainer Validate (PostResultContainer postResultContainer)
 
PostResult Validate (PostResult postResult)
 
JQueryReturn Validate (JQueryReturn jQueryReturn)
 
List<(PostContainer, CommentContainer)> Validate (List<(PostContainer, CommentContainer)> ps)
 
CommentResultContainer Validate (CommentResultContainer commentResultContainer)
 
SubredditContainer Validate (SubredditContainer subredditContainer)
 

Protected Member Functions

override Thread CreateMonitoringThread (string key, string subKey, int startDelayMs=0, int? monitoringDelayMs=null)
 Creates a new monitoring thread. More...
 
- Protected Member Functions inherited from Reddit.Controllers.Internal.Monitors
bool Monitor (string key, Thread thread, string subKey)
 
void RebuildThreads (string subKey)
 
void LaunchThreadIfNotNull (string key, Thread thread)
 
void KillThread (Thread thread)
 
void KillThread (string key)
 
void ResetThreads (List< string > oldThreads)
 
- Protected Member Functions inherited from Reddit.Controllers.Internal.Validators
void CheckErrors (List< List< string >> errors)
 
void CheckErrors (List< string > errors)
 
void CheckNull (object res, string msg="Reddit API returned null response.")
 

Properties

List< string >? Pages [get, set]
 List of pages on this wiki. More...
 
- Properties inherited from Reddit.Controllers.Internal.Monitors
IDictionary< string, HashSet< string > > MonitoringCache [get, set]
 An optional cache for preventing the same post from appearing multiple times during monitoring. See: https://github.com/sirkris/Reddit.NET/issues/117#issuecomment-759501039 More...
 
- Properties inherited from Reddit.Controllers.BaseController
Lists Lists [get, set]
 List-handling. More...
 

Events

EventHandler< WikiPagesUpdateEventArgsPagesUpdated
 Event handler for monitoring the list of wiki pages. More...
 

Additional Inherited Members

- Public Attributes inherited from Reddit.Controllers.Internal.Monitors
int MonitoringWaitDelayMS = 1500
 
- Protected Attributes inherited from Reddit.Controllers.Internal.Monitors
volatile bool Terminate = false
 

Detailed Description

Controller class for a subreddit's wiki.

Constructor & Destructor Documentation

◆ Wiki()

Reddit.Controllers.Wiki.Wiki ( Dispatch  dispatch,
string  subreddit 
)

Create a new instance of the wiki controller.

Parameters
dispatch
subredditThe name of the subreddit to which this wiki belongs

Member Function Documentation

◆ CreateMonitoringThread()

override Thread Reddit.Controllers.Wiki.CreateMonitoringThread ( string  key,
string  subKey,
int  startDelayMs = 0,
int?  monitoringDelayMs = null 
)
protectedvirtual

Creates a new monitoring thread.

Parameters
keyMonitoring key
subKeyMonitoring subKey
startDelayMsHow long to wait before starting the thread in milliseconds (default: 0)
monitoringDelayMsHow long to wait between monitoring queries; pass null to leave it auto-managed (default: null)
Returns
The newly-created monitoring thread.

Implements Reddit.Controllers.Internal.Monitors.

◆ GetBannedUsers() [1/2]

List<BannedUser> Reddit.Controllers.Wiki.GetBannedUsers ( string  after = "",
string  before = "",
int  limit = 25,
string  user = "",
bool  includeCategories = false,
int  count = 0,
string  show = "all",
bool  srDetail = false 
)

Get a list of users who were banned from this subreddit's wiki.

Parameters
afterfullname of a thing
beforefullname of a thing
limitthe maximum number of items desired (default: 25, maximum: 100)
userA valid, existing reddit username
includeCategoriesboolean value
counta positive integer (default: 0)
show(optional) the string all
srDetail(optional) expand subreddits
Returns
A list of banned users.

◆ GetBannedUsers() [2/2]

List<BannedUser> Reddit.Controllers.Wiki.GetBannedUsers ( SubredditsAboutInput  subredditsAboutInput)

Get the approved submitters of this subreddit's wiki.

Parameters
subredditsAboutInputA valid SubredditsAboutInput instance
Returns
A list of subreddit contributors.

◆ GetContributors() [1/2]

List<SubredditUser> Reddit.Controllers.Wiki.GetContributors ( string  after = "",
string  before = "",
int  limit = 25,
string  user = "",
bool  includeCategories = false,
int  count = 0,
string  show = "all",
bool  srDetail = false 
)

Get the approved submitters of this subreddit's wiki.

Parameters
afterfullname of a thing
beforefullname of a thing
limitthe maximum number of items desired (default: 25, maximum: 100)
userA valid, existing reddit username
includeCategoriesboolean value
counta positive integer (default: 0)
show(optional) the string all
srDetail(optional) expand subreddits
Returns
A list of subreddit contributors.

◆ GetContributors() [2/2]

List<SubredditUser> Reddit.Controllers.Wiki.GetContributors ( SubredditsAboutInput  subredditsAboutInput)

Get the approved submitters of this subreddit's wiki.

Parameters
subredditsAboutInputA valid SubredditsAboutInput instance
Returns
A list of subreddit contributors.

◆ GetPage()

WikiPage Reddit.Controllers.Wiki.GetPage ( string  pageName,
string  v = "",
string  v2 = "" 
)

Return the content of an existing wiki page. If v is given, show the wiki page as it was at that version. If both v and v2 are given, show a diff of the two.

Parameters
pageNamethe name of an existing wiki page
va wiki revision ID
v2a wiki revision ID
Returns
A new instance of the WikiPage controller populated with the return data.

◆ GetPages()

List<string> Reddit.Controllers.Wiki.GetPages ( )

Retrieve a list of wiki pages in this subreddit.

Returns
>A list of wiki pages.

◆ GetRecentPageRevisions() [1/2]

List<Things.WikiPageRevision> Reddit.Controllers.Wiki.GetRecentPageRevisions ( int  limit = 25,
string  after = "",
string  before = "",
string  show = "all",
bool  srDetail = false,
int  count = 0 
)

Retrieve a list of recently changed wiki pages in this subreddit.

Parameters
limitthe maximum number of items desired (default: 25, maximum: 100)
afterfullname of a thing
beforefullname of a thing
show(optional) the string all
srDetail(optional) expand subreddits
counta positive integer (default: 0)
Returns
A list of wiki pages.

◆ GetRecentPageRevisions() [2/2]

List<Things.WikiPageRevision> Reddit.Controllers.Wiki.GetRecentPageRevisions ( SrListingInput  srListingInput)

Retrieve a list of recently changed wiki pages in this subreddit.

Parameters
srListingInputA valid SrListingInput instance
Returns
A list of wiki pages.

◆ MonitorPages()

bool Reddit.Controllers.Wiki.MonitorPages ( int?  monitoringDelayMs = null,
int?  monitoringBaseDelayMs = null,
List< MonitoringSchedule schedule = null,
bool?  breakOnFailure = null,
DateTime?  monitoringExpiration = null,
bool  useCache = true 
)

Monitor this wiki for added/removed pages.

Parameters
monitoringDelayMsThe number of milliseconds between each monitoring query; leave null to auto-manage
monitoringBaseDelayMsThe number of milliseconds between each monitoring query PER THREAD (default: 1500)
scheduleA list of one or more timeframes during which monitoring of this object will occur (default: 24/7)
breakOnFailureIf true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false)
monitoringExpirationIf set, monitoring will automatically stop after the specified DateTime is reached
useCacheWhether to cache the IDs of the monitoring results to prevent duplicate fires (default: true)
Returns
Whether monitoring was successfully initiated.

◆ Page() [1/3]

WikiPage Reddit.Controllers.Wiki.Page ( string  pageName)

Return a new instance of the WikiPage controller.

Parameters
pageNamethe name of an existing wiki page
Returns
A new instance of the WikiPage controller.

◆ Page() [2/3]

WikiPage Reddit.Controllers.Wiki.Page ( string  pageName,
bool  mayRevise,
DateTime  revisionDate,
string  contentHtml,
User  revisionBy,
string  contentMd 
)

Return a new instance of the WikiPage controller.

Parameters
pageNamethe name of an existing wiki page
mayReviseboolean value
revisionDateDate of current revision
contentHtmlPage content as HTML
revisionByAuthor of current revision
contentMdPage content as Markdown
Returns
A new instance of the WikiPage controller.

◆ Page() [3/3]

WikiPage Reddit.Controllers.Wiki.Page ( string  pageName,
Things.WikiPage  wikiPage 
)

Return a new instance of the WikiPage controller.

Parameters
pageNamethe name of an existing wiki page
wikiPageA valid instance of Things.WikiPage
Returns
A new instance of the WikiPage controller.

◆ WikiPagesIsMonitored()

bool Reddit.Controllers.Wiki.WikiPagesIsMonitored ( )

Whether the wiki pages list is being monitored.

Returns
Whether the wiki pages list is being monitored.

Property Documentation

◆ Pages

List<string>? Reddit.Controllers.Wiki.Pages
getset

List of pages on this wiki.

Event Documentation

◆ PagesUpdated

EventHandler<WikiPagesUpdateEventArgs> Reddit.Controllers.Wiki.PagesUpdated

Event handler for monitoring the list of wiki pages.


The documentation for this class was generated from the following file: