![]() |
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.
|
Controller class for wiki pages. More...
Public Member Functions | |
WikiPage (Dispatch dispatch, bool mayRevise, DateTime revisionDate, string contentHtml, User revisionBy, string contentMd, string subreddit=null, string name=null) | |
Create a new wiki page controller instance, populated manually. More... | |
WikiPage (Dispatch dispatch, Things.WikiPage wikiPage, string subreddit=null, string name=null) | |
Create a new wiki page controller instance from API return data. More... | |
WikiPage (Dispatch dispatch, string subreddit=null, string name=null) | |
Create a new wiki page controller instance, populated only with subreddit and name. More... | |
WikiPage (Dispatch dispatch) | |
Create an empty wiki page controller instance. More... | |
void | AllowEditor (string username) |
Allow username to edit this wiki page. More... | |
async Task | AllowEditorAsync (string username) |
Asynchronously allow username to edit this wiki page. More... | |
void | DenyEditor (string username) |
Deny username to edit this wiki page. More... | |
async Task | DenyEditorAsync (string username) |
Asynchronously deny username to edit this wiki page. More... | |
WikiPage | EditAndReturn (string reason, string content=null, string previous="") |
Edit a wiki page and return an instance with the updated data. More... | |
WikiPage | EditAndReturn (WikiEditPageInput wikiEditPageInput) |
Edit a wiki page and return an instance with the updated data. More... | |
void | Edit (string reason, string content=null, string previous="") |
Edit this wiki page. More... | |
async Task | EditAsync (string reason, string content=null, string previous="") |
Edit this wiki page asynchronously. More... | |
void | Edit (WikiEditPageInput wikiEditPageInput) |
Edit this wiki page. More... | |
async Task | EditAsync (WikiEditPageInput wikiEditPageInput) |
Edit this wiki page asynchronously. More... | |
void | SaveChanges (string reason, string previous="") |
Edit this wiki page with the current values of this instance. More... | |
async Task | SaveChangesAsync (string reason, string previous="") |
Edit this wiki page with the current values of this instance asynchronously. More... | |
WikiPage | CreateAndReturn (string reason, string content=null) |
Create a new wiki page and return an instance with the updated data. More... | |
void | Create (string reason, string content=null) |
Create a new wiki page. More... | |
async Task | CreateAsync (string reason, string content=null) |
Create a new wiki page asynchronously. More... | |
bool | Hide (string revision) |
Toggle the public visibility of a wiki page revision. More... | |
async Task< bool > | HideAsync (string revision) |
Toggle the public visibility of a wiki page revision asynchronously. More... | |
void | Revert (string revision) |
Revert a wiki page to revision. More... | |
WikiPage | RevertAndReturn (string revision) |
Revert a wiki page to revision and return an instance with the updated data. More... | |
async Task | RevertAsync (string revision) |
Revert a wiki page to revision asynchronously. More... | |
List< WikiPageRevision > | Revisions (int limit=25, string after="", string before="", string show="all", bool srDetail=false, int count=0) |
Retrieve a list of revisions of this wiki page. More... | |
List< WikiPageRevision > | Revisions (SrListingInput srListingInput) |
Retrieve a list of revisions of this wiki page. More... | |
WikiPageSettings | GetPermissions () |
Retrieve the current permission settings for page. More... | |
WikiPageSettings | UpdatePermissions (bool listed, int permLevel) |
Update the permissions and visibility of wiki page. More... | |
async Task< WikiPageSettings > | UpdatePermissionsAsync (bool listed, int permLevel) |
Update the permissions and visibility of wiki page asynchronously. More... | |
WikiPageSettings | UpdatePermissions (WikiUpdatePermissionsInput wikiUpdatePermissionsInput) |
Update the permissions and visibility of wiki page. More... | |
async Task< WikiPageSettings > | UpdatePermissionsAsync (WikiUpdatePermissionsInput wikiUpdatePermissionsInput) |
Update the permissions and visibility of wiki page asynchronously. More... | |
WikiPageSettings | UpdatePermissions (WikiPageSettings wikiPageSettings) |
Update the permissions and visibility of wiki page. More... | |
async Task< WikiPageSettings > | UpdatePermissionsAsync (WikiPageSettings wikiPageSettings) |
Update the permissions and visibility of wiki page asynchronously. More... | |
WikiPage | About (string v="", string v2="") |
Return the content of a 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... | |
bool | MonitorPage (int? monitoringDelayMs=null, int? monitoringBaseDelayMs=null, List< MonitoringSchedule > schedule=null, bool? breakOnFailure=null, DateTime? monitoringExpiration=null) |
Monitor this wiki page for any changes. More... | |
bool | WikiPagesIsMonitored () |
Whether updates to this wiki page are being monitored. More... | |
![]() | |
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 () |
![]() | |
BaseController () | |
Create a new Controller instance. More... | |
![]() | |
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< ActionResult > | Validate (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< UserPrefsContainer > | Validate (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... | |
![]() | |
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) |
![]() | |
void | CheckErrors (List< List< string >> errors) |
void | CheckErrors (List< string > errors) |
void | CheckNull (object res, string msg="Reddit API returned null response.") |
Properties | |
bool | MayRevise [get, set] |
Whether the authenticated user can edit this page. More... | |
DateTime | RevisionDate [get, set] |
The current revision date. More... | |
string | ContentHTML [get, set] |
The page content rendered as HTML. More... | |
User | RevisionBy [get, set] |
The user who authored the current revision. More... | |
string | ContentMd [get, set] |
The page content. More... | |
string | Name [get, set] |
The page name. More... | |
string | Subreddit [get, set] |
The name of the subreddit this wiki belongs to. More... | |
![]() | |
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... | |
![]() | |
Lists | Lists [get, set] |
List-handling. More... | |
Events | |
EventHandler< WikiPageUpdateEventArgs > | PageUpdated |
Event handler for monitoring update to this wiki page. More... | |
Additional Inherited Members | |
![]() | |
int | MonitoringWaitDelayMS = 1500 |
![]() | |
volatile bool | Terminate = false |
Controller class for wiki pages.
Reddit.Controllers.WikiPage.WikiPage | ( | Dispatch | dispatch, |
bool | mayRevise, | ||
DateTime | revisionDate, | ||
string | contentHtml, | ||
User | revisionBy, | ||
string | contentMd, | ||
string | subreddit = null , |
||
string | name = null |
||
) |
Create a new wiki page controller instance, populated manually.
dispatch | |
mayRevise | |
revisionDate | |
contentHtml | |
revisionBy | |
contentMd | |
subreddit | |
name |
Reddit.Controllers.WikiPage.WikiPage | ( | Dispatch | dispatch, |
Things.WikiPage | wikiPage, | ||
string | subreddit = null , |
||
string | name = null |
||
) |
Create a new wiki page controller instance from API return data.
dispatch | |
wikiPage | |
subreddit | |
name |
Reddit.Controllers.WikiPage.WikiPage | ( | Dispatch | dispatch, |
string | subreddit = null , |
||
string | name = null |
||
) |
Create a new wiki page controller instance, populated only with subreddit and name.
dispatch | |
subreddit | |
name |
Reddit.Controllers.WikiPage.WikiPage | ( | Dispatch | dispatch | ) |
Create an empty wiki page controller instance.
dispatch |
WikiPage Reddit.Controllers.WikiPage.About | ( | string | v = "" , |
string | v2 = "" |
||
) |
Return the content of a 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.
v | a wiki revision ID |
v2 | a wiki revision ID |
void Reddit.Controllers.WikiPage.AllowEditor | ( | string | username | ) |
Allow username to edit this wiki page.
username | the name of an existing user |
async Task Reddit.Controllers.WikiPage.AllowEditorAsync | ( | string | username | ) |
Asynchronously allow username to edit this wiki page.
username | the name of an existing user |
void Reddit.Controllers.WikiPage.Create | ( | string | reason, |
string | content = null |
||
) |
Create a new wiki page.
reason | a string up to 256 characters long, consisting of printable characters |
content | The page content |
WikiPage Reddit.Controllers.WikiPage.CreateAndReturn | ( | string | reason, |
string | content = null |
||
) |
Create a new wiki page and return an instance with the updated data.
reason | a string up to 256 characters long, consisting of printable characters |
content | The page content |
async Task Reddit.Controllers.WikiPage.CreateAsync | ( | string | reason, |
string | content = null |
||
) |
Create a new wiki page asynchronously.
reason | a string up to 256 characters long, consisting of printable characters |
content | The page content |
|
protectedvirtual |
Creates a new monitoring thread.
key | Monitoring key |
subKey | Monitoring subKey |
startDelayMs | How long to wait before starting the thread in milliseconds (default: 0) |
monitoringDelayMs | How long to wait between monitoring queries; pass null to leave it auto-managed (default: null) |
Implements Reddit.Controllers.Internal.Monitors.
void Reddit.Controllers.WikiPage.DenyEditor | ( | string | username | ) |
Deny username to edit this wiki page.
username | the name of an existing user |
async Task Reddit.Controllers.WikiPage.DenyEditorAsync | ( | string | username | ) |
Asynchronously deny username to edit this wiki page.
username | the name of an existing user |
void Reddit.Controllers.WikiPage.Edit | ( | string | reason, |
string | content = null , |
||
string | previous = "" |
||
) |
Edit this wiki page.
reason | a string up to 256 characters long, consisting of printable characters |
content | The page content |
previous | the starting point revision for this edit |
void Reddit.Controllers.WikiPage.Edit | ( | WikiEditPageInput | wikiEditPageInput | ) |
Edit this wiki page.
wikiEditPageInput | A valid WikiEditPageInput instance |
WikiPage Reddit.Controllers.WikiPage.EditAndReturn | ( | string | reason, |
string | content = null , |
||
string | previous = "" |
||
) |
Edit a wiki page and return an instance with the updated data.
reason | a string up to 256 characters long, consisting of printable characters |
content | The page content |
previous | the starting point revision for this edit |
WikiPage Reddit.Controllers.WikiPage.EditAndReturn | ( | WikiEditPageInput | wikiEditPageInput | ) |
Edit a wiki page and return an instance with the updated data.
wikiEditPageInput | A valid WikiEditPageInput instance |
async Task Reddit.Controllers.WikiPage.EditAsync | ( | string | reason, |
string | content = null , |
||
string | previous = "" |
||
) |
Edit this wiki page asynchronously.
reason | a string up to 256 characters long, consisting of printable characters |
content | The page content |
previous | the starting point revision for this edit |
async Task Reddit.Controllers.WikiPage.EditAsync | ( | WikiEditPageInput | wikiEditPageInput | ) |
Edit this wiki page asynchronously.
wikiEditPageInput | A valid WikiEditPageInput instance |
WikiPageSettings Reddit.Controllers.WikiPage.GetPermissions | ( | ) |
Retrieve the current permission settings for page.
bool Reddit.Controllers.WikiPage.Hide | ( | string | revision | ) |
Toggle the public visibility of a wiki page revision.
revision | a wiki revision ID |
async Task<bool> Reddit.Controllers.WikiPage.HideAsync | ( | string | revision | ) |
Toggle the public visibility of a wiki page revision asynchronously.
revision | a wiki revision ID |
bool Reddit.Controllers.WikiPage.MonitorPage | ( | int? | monitoringDelayMs = null , |
int? | monitoringBaseDelayMs = null , |
||
List< MonitoringSchedule > | schedule = null , |
||
bool? | breakOnFailure = null , |
||
DateTime? | monitoringExpiration = null |
||
) |
Monitor this wiki page for any changes.
monitoringDelayMs | The number of milliseconds between each monitoring query; leave null to auto-manage |
monitoringBaseDelayMs | The number of milliseconds between each monitoring query PER THREAD (default: 1500) |
schedule | A list of one or more timeframes during which monitoring of this object will occur (default: 24/7) |
breakOnFailure | If true, an exception will be thrown when a monitoring query fails; leave null to keep current setting (default: false) |
monitoringExpiration | If set, monitoring will automatically stop after the specified DateTime is reached |
void Reddit.Controllers.WikiPage.Revert | ( | string | revision | ) |
Revert a wiki page to revision.
revision | a wiki revision ID |
WikiPage Reddit.Controllers.WikiPage.RevertAndReturn | ( | string | revision | ) |
Revert a wiki page to revision and return an instance with the updated data.
revision | a wiki revision ID |
async Task Reddit.Controllers.WikiPage.RevertAsync | ( | string | revision | ) |
Revert a wiki page to revision asynchronously.
revision | a wiki revision ID |
List<WikiPageRevision> Reddit.Controllers.WikiPage.Revisions | ( | int | limit = 25 , |
string | after = "" , |
||
string | before = "" , |
||
string | show = "all" , |
||
bool | srDetail = false , |
||
int | count = 0 |
||
) |
Retrieve a list of revisions of this wiki page.
limit | the maximum number of items desired (default: 25, maximum: 100) |
after | fullname of a thing |
before | fullname of a thing |
show | (optional) the string all |
srDetail | (optional) expand subreddits |
count | a positive integer (default: 0) |
List<WikiPageRevision> Reddit.Controllers.WikiPage.Revisions | ( | SrListingInput | srListingInput | ) |
Retrieve a list of revisions of this wiki page.
srListingInput | A valid SrListingInput instance |
void Reddit.Controllers.WikiPage.SaveChanges | ( | string | reason, |
string | previous = "" |
||
) |
Edit this wiki page with the current values of this instance.
reason | a string up to 256 characters long, consisting of printable characters |
previous | the starting point revision for this edit |
async Task Reddit.Controllers.WikiPage.SaveChangesAsync | ( | string | reason, |
string | previous = "" |
||
) |
Edit this wiki page with the current values of this instance asynchronously.
reason | a string up to 256 characters long, consisting of printable characters |
previous | the starting point revision for this edit |
WikiPageSettings Reddit.Controllers.WikiPage.UpdatePermissions | ( | bool | listed, |
int | permLevel | ||
) |
Update the permissions and visibility of wiki page.
listed | boolean value (true = appear in /wiki/pages, false = don't appear in /wiki/pages) |
permLevel | an integer (0 = use wiki perms, 1 = only approved users may edit, 2 = only mods may edit or view) |
WikiPageSettings Reddit.Controllers.WikiPage.UpdatePermissions | ( | WikiPageSettings | wikiPageSettings | ) |
Update the permissions and visibility of wiki page.
wikiPageSettings | A valid instance of WikiPageSettings |
WikiPageSettings Reddit.Controllers.WikiPage.UpdatePermissions | ( | WikiUpdatePermissionsInput | wikiUpdatePermissionsInput | ) |
Update the permissions and visibility of wiki page.
wikiUpdatePermissionsInput | A valid WikiUpdatePermissionsInput instance |
async Task<WikiPageSettings> Reddit.Controllers.WikiPage.UpdatePermissionsAsync | ( | bool | listed, |
int | permLevel | ||
) |
Update the permissions and visibility of wiki page asynchronously.
listed | boolean value (true = appear in /wiki/pages, false = don't appear in /wiki/pages) |
permLevel | an integer (0 = use wiki perms, 1 = only approved users may edit, 2 = only mods may edit or view) |
async Task<WikiPageSettings> Reddit.Controllers.WikiPage.UpdatePermissionsAsync | ( | WikiPageSettings | wikiPageSettings | ) |
Update the permissions and visibility of wiki page asynchronously.
wikiPageSettings | A valid instance of WikiPageSettings |
async Task<WikiPageSettings> Reddit.Controllers.WikiPage.UpdatePermissionsAsync | ( | WikiUpdatePermissionsInput | wikiUpdatePermissionsInput | ) |
Update the permissions and visibility of wiki page asynchronously.
wikiUpdatePermissionsInput | A valid WikiUpdatePermissionsInput instance |
bool Reddit.Controllers.WikiPage.WikiPagesIsMonitored | ( | ) |
Whether updates to this wiki page are being monitored.
|
getset |
The page content rendered as HTML.
|
getset |
The page content.
|
getset |
Whether the authenticated user can edit this page.
|
getset |
The page name.
|
getset |
The user who authored the current revision.
|
getset |
The current revision date.
|
getset |
The name of the subreddit this wiki belongs to.
EventHandler<WikiPageUpdateEventArgs> Reddit.Controllers.WikiPage.PageUpdated |
Event handler for monitoring update to this wiki page.