C# Класс FreshFace.models.StockEngine

Provides near real-time stock quotes. From http://madskristensen.net/post/Stock-quote-class-in-C.aspx
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
OnError ( ) : void
OnUpdated ( ) : void

Приватные методы

Метод Описание
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.

Описание методов

Execute() публичный статический Метод

Retrieves the stock quote from the Internet.
public static Execute ( string symbol ) : StockEngine
symbol string Specify the symbol of the stock to retrieve.
Результат StockEngine

OnError() защищенный Метод

protected OnError ( ) : void
Результат void

OnUpdated() защищенный Метод

protected OnUpdated ( ) : void
Результат void

StockEngine() публичный Метод

Create an instance of StockEngine.
public StockEngine ( string symbol ) : System
symbol string The symbol of the quote to retrieve.
Результат System

StockEngine() публичный Метод

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.
Результат System

StockEngine() публичный Метод

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.
Результат System