C# 클래스 ForTheCommonGood.MorebitsDotNet

파일 보기 프로젝트 열기: atlight/ForTheCommonGood 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
LoginSessions LoginInfo>.Dictionary

공개 메소드들

메소드 설명
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.

비공개 메소드들

메소드 설명
GetApiUri ( Wiki w ) : string
PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess, MorebitsDotNetError onError, bool loggingIn, string method ) : void
TimeoutCallback ( object state, bool timedOut ) : void

메소드 상세

DefaultErrorHandler() 공개 정적인 메소드

public static DefaultErrorHandler ( string message ) : void
message string
리턴 void

DefaultErrorHandler() 공개 정적인 메소드

public static DefaultErrorHandler ( string message, MessageBoxIcon icon ) : void
message string
icon MessageBoxIcon
리턴 void

GetApi() 공개 정적인 메소드

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 .
리턴 void

GetDomain() 공개 정적인 메소드

public static GetDomain ( Wiki w ) : string
w Wiki
리턴 string

GetProtocol() 공개 정적인 메소드

public static GetProtocol ( ) : string
리턴 string

LogIn() 공개 정적인 메소드

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.
리턴 void

PostApi() 공개 정적인 메소드

public static PostApi ( Wiki wiki, StringDictionary query, MorebitsDotNetPostSuccess onSuccess ) : void
wiki Wiki
query System.Collections.Specialized.StringDictionary
onSuccess MorebitsDotNetPostSuccess
리턴 void

PostApi() 공개 정적인 메소드

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

PostApi() 공개 정적인 메소드

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 .
리턴 void

UploadFile() 공개 정적인 메소드

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
리턴 void

UploadFile() 공개 정적인 메소드

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.
리턴 void

프로퍼티 상세

LoginSessions 공개적으로 정적으로 프로퍼티

public static Dictionary LoginSessions
리턴 LoginInfo>.Dictionary