C# Class ForTheCommonGood.MorebitsDotNet

Afficher le fichier Open project: atlight/ForTheCommonGood Class Usage Examples

Méthodes publiques

Свойство Type Description
LoginSessions LoginInfo>.Dictionary

Méthodes publiques

Méthode Description
DefaultErrorHandler ( string message ) : void
DefaultErrorHandler ( string message, MessageBoxIcon icon ) : void
GetApi ( Wiki wiki, string queryString, object userToken, MorebitsDotNetGetSuccess onSuccess ) : void

Makes an HTTP GET request to the specified MediaWiki API endpoint.

GetDomain ( Wiki w ) : string
GetProtocol ( ) : string
LogIn ( Wiki wiki, string userName, string password, MorebitsDotNetLoginSuccess onSuccess, MorebitsDotNetError onError ) : void

Logs into the specified MediaWiki API endpoint.

PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess ) : void
PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError ) : void
PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError, string method ) : void

Makes an HTTP request to the specified MediaWiki API endpoint.

UploadFile ( Wiki wiki, StringDictionary query, byte file, string fileName, string fileParamName, MorebitsDotNetPostSuccess onSuccess ) : void
UploadFile ( Wiki wiki, StringDictionary query, byte file, string fileName, string fileParamName, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError ) : void

Uploads a file by making an HTTP POST request to the specified MediaWiki API endpoint.

Private Methods

Méthode Description
GetApiUri ( Wiki w ) : string
PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError, bool loggingIn, string method ) : void
TimeoutCallback ( object state, bool timedOut ) : void

Method Details

DefaultErrorHandler() public static méthode

public static DefaultErrorHandler ( string message ) : void
message string
Résultat void

DefaultErrorHandler() public static méthode

public static DefaultErrorHandler ( string message, MessageBoxIcon icon ) : void
message string
icon MessageBoxIcon
Résultat void

GetApi() public static méthode

Makes an HTTP GET request to the specified MediaWiki API endpoint.
public static GetApi ( Wiki wiki, string queryString, object userToken, MorebitsDotNetGetSuccess onSuccess ) : void
wiki Wiki The to contact.
queryString string The query string, to be appended to the URL after a "?" character. /// No escaping is performed.
userToken object A custom object that is passed on to the callback, for state tracking. /// Set to null if not required.
onSuccess MorebitsDotNetGetSuccess A function that will be called when the request is successful. /// The function is passed the string of response received, as well as the value of .
Résultat void

GetDomain() public static méthode

public static GetDomain ( Wiki w ) : string
w Wiki
Résultat string

GetProtocol() public static méthode

public static GetProtocol ( ) : string
Résultat string

LogIn() public static méthode

Logs into the specified MediaWiki API endpoint.
public static LogIn ( Wiki wiki, string userName, string password, MorebitsDotNetLoginSuccess onSuccess, MorebitsDotNetError onError ) : void
wiki Wiki The to contact.
userName string The user name to use for the login attempt.
password string The password to use for the login attempt.
onSuccess MorebitsDotNetLoginSuccess A function that will be called when the login attempt is successful.
onError MorebitsDotNetError A function that will be called when the login attempt fails. /// The function is passed the error message string as its only parameter.
Résultat void

PostApi() public static méthode

public static PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess ) : void
wiki Wiki
query System.Collections.Specialized.StringDictionary
onSuccess MorebitsDotNetPostSuccess
Résultat void

PostApi() public static méthode

public static PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError ) : void
wiki Wiki
query System.Collections.Specialized.StringDictionary
onSuccess MorebitsDotNetPostSuccess
onError MorebitsDotNetError
Résultat void

PostApi() public static méthode

Makes an HTTP request to the specified MediaWiki API endpoint.
public static PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError, string method ) : void
wiki Wiki The to contact.
query System.Collections.Specialized.StringDictionary A dictionary of key-value pairs that represent the request parameters.
onSuccess MorebitsDotNetPostSuccess A function that will be called when the request is successful. /// The function is passed the XML response as its only parameter.
onError MorebitsDotNetError A function that will be called when the request fails. /// The function is passed the error message string as its only parameter.
method string The HTTP method to use. Use one of the constants in .
Résultat void

UploadFile() public static méthode

public static UploadFile ( Wiki wiki, StringDictionary query, byte file, string fileName, string fileParamName, MorebitsDotNetPostSuccess onSuccess ) : void
wiki Wiki
query System.Collections.Specialized.StringDictionary
file byte
fileName string
fileParamName string
onSuccess MorebitsDotNetPostSuccess
Résultat void

UploadFile() public static méthode

Uploads a file by making an HTTP POST request to the specified MediaWiki API endpoint.
public static UploadFile ( Wiki wiki, StringDictionary query, byte file, string fileName, string fileParamName, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError ) : void
wiki Wiki The to contact.
query System.Collections.Specialized.StringDictionary A dictionary of key-value pairs that represent the request parameters.
file byte The file to upload, as a byte array of binary data.
fileName string The name of the file to upload.
fileParamName string The name (key) of the POST parameter whose value is the file data.
onSuccess MorebitsDotNetPostSuccess A function that will be called when the request is successful. /// The function is passed the XML response as its only parameter.
onError MorebitsDotNetError A function that will be called when the request fails. /// The function is passed the error message string as its only parameter.
Résultat void

Property Details

LoginSessions public_oe static_oe property

public static Dictionary LoginSessions
Résultat LoginInfo>.Dictionary