C# Class WolframAPI.WAClient

Used to access Wolfram Alpha. Submits expressions, retrieves and parses responses.
ファイルを表示 Open project: Schumix/Schumix2 Class Usage Examples

Public Methods

Method Description
GetResult ( string expression ) : WAResult

Gets the result of the specified expression.

The expression is returned as WAResult

so you can manually go through the pods of the response (to get ANY information you'd like)

It is encouraged to use this method instead of Solve

GetResultAsync ( string expression ) : void

Gets the result of the specified expression asynchronously.

The expression is returned as WAResult

so you can manually go through the pods of the response (to get ANY information you'd like)

It is encouraged to use this method instead of Solve

An event is raised upon completion.

Parse ( string response ) : WAResult

Parses the raw response.

Solve ( string expression ) : string

Solves the specified expression.

SolveAsync ( string expression ) : void

Solves the specified expression asynchronously. An event is raised on completion.

Submit ( string expression ) : string

Submits the specified expression and returns the raw result.

WAClient ( string appId ) : System

Initializes a new instance of the WAClient class.

Private Methods

Method Description
HandleResultReceived ( IAsyncResult ar ) : void
HandleSolutionReceived ( IAsyncResult ar ) : void

Method Details

GetResult() public method

Gets the result of the specified expression.

The expression is returned as WAResult

so you can manually go through the pods of the response (to get ANY information you'd like)

It is encouraged to use this method instead of Solve

Throws in case of any error. Throws if the specified argument is null.
public GetResult ( string expression ) : WAResult
expression string The expression to solve.
return WAResult

GetResultAsync() public method

Gets the result of the specified expression asynchronously.

The expression is returned as WAResult

so you can manually go through the pods of the response (to get ANY information you'd like)

It is encouraged to use this method instead of Solve

An event is raised upon completion.
Throws in case of any error. Throws if the specified argument is null.
public GetResultAsync ( string expression ) : void
expression string The expression to solve.
return void

Parse() public static method

Parses the raw response.
Throws in case of any error. Throws if the specified argument is null.
public static Parse ( string response ) : WAResult
response string The response to parse
return WAResult

Solve() public method

Solves the specified expression.
Throws in case of any error. Throws if the specified argument is null.
public Solve ( string expression ) : string
expression string The expression.
return string

SolveAsync() public method

Solves the specified expression asynchronously. An event is raised on completion.
Throws in case of any error. Throws if the specified argument is null.
public SolveAsync ( string expression ) : void
expression string The expression.
return void

Submit() public method

Submits the specified expression and returns the raw result.
Throws in case of any error. Throws if the specified argument is null.
public Submit ( string expression ) : string
expression string The expression to post.
return string

WAClient() public method

Initializes a new instance of the WAClient class.
public WAClient ( string appId ) : System
appId string The application ID provided by Wolfram. You have to request one for each of your apps.
return System