DotNetWikiBot Framework Documentation
The Bot type exposes the following members.
Methods
| Name | Description | |
|---|---|---|
| Capitalize | This auxiliary function makes the first letter in specified string upper-case.
This is often required, but strangely there is no such function in .NET Framework's
String class. | |
| CountMatches | This auxiliary function counts the occurrences of specified string
in specified text. This count is often required, but strangely there is no
such function in .NET Framework's String class. | |
| DisableSilenceMode | Call this function to disable silent mode previously enabled by
EnableSilenceMode()()()() function. | |
| EnableLogging | Call this function to make bot write all output to the specified file
instead of a console. If only error logging is desirable, first call this
function and after that call EnableSilenceMode()()()() function. | |
| EnableSilenceMode | Call this function to make bot report only errors and warnings,
no other messages will be displayed or logged. | |
| GetMatchesPositions | This auxiliary function returns the zero-based indexes of all occurrences
of specified string in specified text. | |
| GetMostRecentSiteObject | Gets most recent Site object constructed by framework. | |
| GetSubstring(String, String, String) | This auxiliary function returns part of the string which begins
with some specified substring and ends with some specified substring. | |
| GetSubstring(String, String, String, Boolean, Boolean, Boolean) | This auxiliary function returns part of the string which begins
with some specified substring and ends with some specified substring. | |
| GetWebResource | This wrapper function gets web resource in a fault-tolerant manner.
It should be used only in simple cases, because it sends no cookies, it doesn't support
traffic compression and it lacks other useful features. | |
| GetXMLIterator | This helper function constructs XPathDocument object, makes XPath query and
returns XPathNodeIterator object for selected nodes. | |
| GetXMLReader | This helper function constructs XmlReader object
using provided XML source code. | |
| GetXMLSubstring | This helper function deletes everything before startTag
and everything after endTag in the provided XML/XHTML source code
and then inserts back the deleted DOCTYPE definition and root element of XML/XHTML
document. | |
| LoadLocalizedMessages | Function loads localized bot's interface messages from
"DotNetWikiBot.i18n.xml" file. Function is called in Bot class constructor,
but it can also be called manually to change interface language at runtime. | |
| Msg | Gets localized (translated) version of specified bot's
interface message. | |
| RemoveXMLRootAttributes | This helper function removes all attributes of root XML/XHTML element
(XML namespace declarations, schema links, etc.) to ease processing. | |
| Uncapitalize | This auxiliary function makes the first letter in specified string lower-case.
This is often required, but strangely there is no such function in .NET Framework's
String class. | |
| UrlEncode | This wrapper function encodes string for use in URI.
The function is necessary because Mono framework doesn't support HttpUtility.UrlEncode()
method and Uri.EscapeDataString() method doesn't support long strings, so a loop is
required. By the way HttpUtility.UrlDecode() is supported by Mono, and a functions
pair Uri.EscapeDataString()/HttpUtility.UrlDecode() is commonly recommended for
encoding/decoding. Although there is another trouble with Uri.EscapeDataString():
prior to .NET 4.5 it doesn't support RFC 3986, only RFC 2396.
| |
| UserConfirms | This function asks user to confirm next action. The message
"Would you like to proceed (y/n/a)? " is displayed and user response is
evaluated. Make sure to set askConfirm variable to "true" before
calling this function. | |
| Wait | Suspends execution for specified number of seconds. |