C# Class FreshFace.models.StockEngine

Provides near real-time stock quotes. From http://madskristensen.net/post/Stock-quote-class-in-C.aspx
Show file Open project: alliekins/FreshFace Class Usage Examples

Public Methods

Method Description
Execute ( string symbol ) : StockEngine

Retrieves the stock quote from the Internet.

StockEngine ( string symbol ) : System

Create an instance of StockEngine.

StockEngine ( string symbol, bool autoUpdate ) : System

Create an instance of StockEngine.

StockEngine ( string symbol, bool autoUpdate, int updateInterval ) : System

Create an instance of StockEngine.

Protected Methods

Method Description
OnError ( ) : void
OnUpdated ( ) : void

Private Methods

Method Description
BeginGetQuote ( ) : void

Starts the asynchonous data retrieval.

CreateRequest ( ) : HttpWebRequest

Creates a web request to Yahoo finacial service.

EndGetQuote ( IAsyncResult stateInfo ) : void

Ends the asynchonous data retrieval.

Init ( string symbol, bool autoUpdate, int updateInterval ) : void

Initializes the object with data from the constructors.

InitializeTimer ( ) : void

Prepares the timer for automatic updates.

ParseQuote ( string html ) : void

Parses the retrieved HTML document in order to substract the right stock quote.

ProcessResponse ( HttpWebRequest request ) : void

Retrieves the response from the web request.

Method Details

Execute() public static method

Retrieves the stock quote from the Internet.
public static Execute ( string symbol ) : StockEngine
symbol string Specify the symbol of the stock to retrieve.
return StockEngine

OnError() protected method

protected OnError ( ) : void
return void

OnUpdated() protected method

protected OnUpdated ( ) : void
return void

StockEngine() public method

Create an instance of StockEngine.
public StockEngine ( string symbol ) : System
symbol string The symbol of the quote to retrieve.
return System

StockEngine() public method

Create an instance of StockEngine.
public StockEngine ( string symbol, bool autoUpdate ) : System
symbol string The symbol of the quote to retrieve.
autoUpdate bool Specify whether or not to automatically update the quote.
return System

StockEngine() public method

Create an instance of StockEngine.
public StockEngine ( string symbol, bool autoUpdate, int updateInterval ) : System
symbol string The symbol of the quote to retrieve.
autoUpdate bool Specify whether or not to automatically update the quote.
updateInterval int Specify at what interval to update. In milliseconds.
return System