C# Class FreshFace.models.StockEngine

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

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
OnError ( ) : void
OnUpdated ( ) : void

Private Methods

Méthode 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 méthode

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

OnError() protected méthode

protected OnError ( ) : void
Résultat void

OnUpdated() protected méthode

protected OnUpdated ( ) : void
Résultat void

StockEngine() public méthode

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

StockEngine() public méthode

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.
Résultat System

StockEngine() public méthode

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.
Résultat System