C# Class Claymore.SharpMediaWiki.Wiki

显示文件 Open project: Claymore/SharpMediaWiki Class Usage Examples

Public Methods

Method Description
Append ( string title, string text, string summary ) : string
Append ( string title, string text, string summary, MinorFlags minor, bool botEdit ) : string
CookiesToArray ( ) : byte[]
Create ( string title, string text, string summary ) : string
Delete ( string title, string reason, string token ) : void
Enumerate ( ParameterCollection parameters, bool getAll ) : XmlDocument
GetNamespace ( int number ) : string
GetNamespaces ( ) : void
LoadCookies ( byte data ) : void
LoadNamespaces ( IEnumerable data ) : void
LoadText ( string title ) : string
Login ( ) : void
Login ( string username, string password ) : void

Logs into the MediaWiki as 'username' using 'password'.

http://www.mediawiki.org/wiki/API:Login

Logout ( ) : void

Logs out from the Wiki.

http://www.mediawiki.org/wiki/API:Logout

MakeRequest ( System.Action action, ParameterCollection parameters ) : XmlDocument
MakeRequest ( Uri uri, RequestMethod method ) : string
Move ( string fromTitle, string toTitle, string reason ) : void
Move ( string fromTitle, string toTitle, string reason, bool moveTalk, bool noRedirect ) : void
Move ( string fromTitle, string toTitle, string reason, string token, bool moveTalk, bool noRedirect ) : void
NamespacesToArray ( ) : byte[]
PageNamespace ( string title ) : int
PrepareQuery ( System.Action action, ParameterCollection parameters ) : string
Prepend ( string title, string text, string summary ) : string
Protect ( string title, List protections, string reason, string token, bool cascade ) : void
Query ( QueryBy queryBy, ParameterCollection parameters, IEnumerable ids ) : XmlDocument
Query ( QueryBy queryBy, ParameterCollection parameters, IEnumerable ids, int limit, bool all ) : XmlDocument
Query ( QueryBy queryBy, ParameterCollection parameters, string id ) : XmlDocument
Review ( string revisionId, string accuracy, string comment, string token ) : void
Save ( string title, string text, string summary ) : string
Save ( string title, string text, string summary, MinorFlags minor, bool botEdit ) : string
Save ( string title, string section, string text, string summary, MinorFlags minor, CreateFlags create, WatchFlags watch, SaveFlags mode, bool bot ) : string
Save ( string title, string section, string text, string summary, MinorFlags minor, CreateFlags create, WatchFlags watch, SaveFlags mode, bool bot, string basetimestamp, string starttimestamp, string token ) : string
SaveSection ( string title, string section, string text, string summary ) : string
Stabilize ( string title, string reason, string editToken ) : void
UnProtect ( string title, string reason, string token ) : void
Upload ( string filename, string comment, string text, WatchFlags watch, byte data, string contentType, bool ignoreWarnings ) : void
Upload ( string filename, string comment, string text, string token, WatchFlags watch, byte data, string contentType, bool ignoreWarnings ) : void
Upload ( string filename, string comment, string text, string token, WatchFlags watch, string url ) : void
Wiki ( string uri ) : System

Initializes a new instance of the Wiki class with the specified URI.

Private Methods

Method Description
ComputeHashString ( string stringToHash ) : string
Enumerate ( ParameterCollection parameters, XmlDocument result, bool all ) : void
EscapeString ( string stringToEscape ) : string

Converts a string to its escaped representation.

FillDocumentWithQueryResults ( string query, XmlDocument document ) : Parameter
GetResponseStream ( HttpWebResponse response ) : Stream
MakeActionException ( System.Action action, string error ) : WikiException
MakeMultipartFormRequest ( ParameterCollection parameters, string filename, string contentType, byte data ) : XmlDocument
PrepareMultipartFormQuery ( ParameterCollection parameters, string filename, string contentType, byte data ) : byte[]
PrepareRequest ( ) : HttpWebRequest
PrepareRequest ( Uri uri, RequestMethod method ) : HttpWebRequest
PrepareRequest ( Uri uri, RequestMethod method, string contentType ) : HttpWebRequest

Method Details

Append() public method

public Append ( string title, string text, string summary ) : string
title string
text string
summary string
return string

Append() public method

public Append ( string title, string text, string summary, MinorFlags minor, bool botEdit ) : string
title string
text string
summary string
minor MinorFlags
botEdit bool
return string

CookiesToArray() public method

public CookiesToArray ( ) : byte[]
return byte[]

Create() public method

public Create ( string title, string text, string summary ) : string
title string
text string
summary string
return string

Delete() public method

public Delete ( string title, string reason, string token ) : void
title string
reason string
token string
return void

Enumerate() public method

public Enumerate ( ParameterCollection parameters, bool getAll ) : XmlDocument
parameters ParameterCollection
getAll bool
return System.Xml.XmlDocument

GetNamespace() public method

public GetNamespace ( int number ) : string
number int
return string

GetNamespaces() public method

public GetNamespaces ( ) : void
return void

LoadCookies() public method

public LoadCookies ( byte data ) : void
data byte
return void

LoadNamespaces() public method

public LoadNamespaces ( IEnumerable data ) : void
data IEnumerable
return void

LoadText() public method

public LoadText ( string title ) : string
title string
return string

Login() public method

public Login ( ) : void
return void

Login() public method

Logs into the MediaWiki as 'username' using 'password'.
http://www.mediawiki.org/wiki/API:Login
Thrown when an error occurs.
public Login ( string username, string password ) : void
username string A username.
password string A password.
return void

Logout() public method

Logs out from the Wiki.
http://www.mediawiki.org/wiki/API:Logout
public Logout ( ) : void
return void

MakeRequest() public method

public MakeRequest ( System.Action action, ParameterCollection parameters ) : XmlDocument
action System.Action
parameters ParameterCollection
return System.Xml.XmlDocument

MakeRequest() public method

public MakeRequest ( Uri uri, RequestMethod method ) : string
uri System.Uri
method RequestMethod
return string

Move() public method

public Move ( string fromTitle, string toTitle, string reason ) : void
fromTitle string
toTitle string
reason string
return void

Move() public method

public Move ( string fromTitle, string toTitle, string reason, bool moveTalk, bool noRedirect ) : void
fromTitle string
toTitle string
reason string
moveTalk bool
noRedirect bool
return void

Move() public method

public Move ( string fromTitle, string toTitle, string reason, string token, bool moveTalk, bool noRedirect ) : void
fromTitle string
toTitle string
reason string
token string
moveTalk bool
noRedirect bool
return void

NamespacesToArray() public method

public NamespacesToArray ( ) : byte[]
return byte[]

PageNamespace() public method

public PageNamespace ( string title ) : int
title string
return int

PrepareQuery() public method

public PrepareQuery ( System.Action action, ParameterCollection parameters ) : string
action System.Action
parameters ParameterCollection
return string

Prepend() public method

public Prepend ( string title, string text, string summary ) : string
title string
text string
summary string
return string

Protect() public method

public Protect ( string title, List protections, string reason, string token, bool cascade ) : void
title string
protections List
reason string
token string
cascade bool
return void

Query() public method

public Query ( QueryBy queryBy, ParameterCollection parameters, IEnumerable ids ) : XmlDocument
queryBy QueryBy
parameters ParameterCollection
ids IEnumerable
return System.Xml.XmlDocument

Query() public method

public Query ( QueryBy queryBy, ParameterCollection parameters, IEnumerable ids, int limit, bool all ) : XmlDocument
queryBy QueryBy
parameters ParameterCollection
ids IEnumerable
limit int
all bool
return System.Xml.XmlDocument

Query() public method

public Query ( QueryBy queryBy, ParameterCollection parameters, string id ) : XmlDocument
queryBy QueryBy
parameters ParameterCollection
id string
return System.Xml.XmlDocument

Review() public method

public Review ( string revisionId, string accuracy, string comment, string token ) : void
revisionId string
accuracy string
comment string
token string
return void

Save() public method

public Save ( string title, string text, string summary ) : string
title string
text string
summary string
return string

Save() public method

public Save ( string title, string text, string summary, MinorFlags minor, bool botEdit ) : string
title string
text string
summary string
minor MinorFlags
botEdit bool
return string

Save() public method

public Save ( string title, string section, string text, string summary, MinorFlags minor, CreateFlags create, WatchFlags watch, SaveFlags mode, bool bot ) : string
title string
section string
text string
summary string
minor MinorFlags
create CreateFlags
watch WatchFlags
mode SaveFlags
bot bool
return string

Save() public method

public Save ( string title, string section, string text, string summary, MinorFlags minor, CreateFlags create, WatchFlags watch, SaveFlags mode, bool bot, string basetimestamp, string starttimestamp, string token ) : string
title string
section string
text string
summary string
minor MinorFlags
create CreateFlags
watch WatchFlags
mode SaveFlags
bot bool
basetimestamp string
starttimestamp string
token string
return string

SaveSection() public method

public SaveSection ( string title, string section, string text, string summary ) : string
title string
section string
text string
summary string
return string

Stabilize() public method

public Stabilize ( string title, string reason, string editToken ) : void
title string
reason string
editToken string
return void

UnProtect() public method

public UnProtect ( string title, string reason, string token ) : void
title string
reason string
token string
return void

Upload() public method

public Upload ( string filename, string comment, string text, WatchFlags watch, byte data, string contentType, bool ignoreWarnings ) : void
filename string
comment string
text string
watch WatchFlags
data byte
contentType string
ignoreWarnings bool
return void

Upload() public method

public Upload ( string filename, string comment, string text, string token, WatchFlags watch, byte data, string contentType, bool ignoreWarnings ) : void
filename string
comment string
text string
token string
watch WatchFlags
data byte
contentType string
ignoreWarnings bool
return void

Upload() public method

public Upload ( string filename, string comment, string text, string token, WatchFlags watch, string url ) : void
filename string
comment string
text string
token string
watch WatchFlags
url string
return void

Wiki() public method

Initializes a new instance of the Wiki class with the specified URI.
public Wiki ( string uri ) : System
uri string
return System