C# Class MEAPI_Samples.frmMEAPI

MEAPI This example demonstrates using the MEAPI to receive available exchanges, products, and contract definitions.
Inheritance: System.Windows.Forms.Form, ITTMarketExplorerEvents, ITTGatewayEvents, ITTProductEvents
ファイルを表示 Open project: tradingtechnologies/CodeSamples_XTAPI_CSharp

Public Methods

Method Description
OnContracts ( ITTGateway Gateway, ITTProduct Product, ITTContractCollection contracts ) : void

TT Gateways deliver a list of contracts associated with the product

OnGateway ( ITTGateway Gateway ) : void

TT Gateways are found in response to a RequestGateways method call or when TT Gateways become available.

OnGatewayAttributes ( ITTGateway Gateway, string attributeList, enumServiceType service ) : void

MEAPI recieves the gateway attribute list (GAL settings) for the TT Gateway.

OnNewContract ( ITTGateway Gateway, ITTProduct Product, ITTContractInfo contractInfo ) : void

TT Gateways add new contracts for a product

OnNewProduct ( ITTGateway Gateway, ITTProduct Product ) : void

TT Gateway recieves new products from an exchange.

OnProductTypes ( ITTGateway Gateway, object productTypes, object productTypesAsString ) : void

TT Gateways return a list of product types hosted on the TT Gateway

OnProducts ( ITTGateway Gateway, ITTProductCollection Products ) : void

TT Gateways return a list of products hosted on the TT Gateway

OnProductsFound ( ITTGateway Gateway, ITTProductCollection Products ) : void

TT Gateways find products that match a product request

OnProductsNotFound ( ITTGateway Gateway ) : void

TT Gateways find no products matching a product request or query.

OnRequestContractsTimeout ( ITTGateway Gateway, ITTProduct Product ) : void

Contract download times out

OnRequestProductsTimeout ( ITTGateway Gateway ) : void

TT Gateways timeout on a product request

OnServerStatus ( ITTGateway Gateway, enumServiceType service, int IsAvailable, int IsLoggedIn ) : void

Status of a TT Gateway server change

PublishGatewayName ( string gatewayName ) : void

Add the gateway to the GUI

PublishProductTypes ( string prodTypes, int prodIndices ) : void

Add the product types to the GUI

PublishProducts ( TreeNode prodNode ) : void

Add the products to the GUI

frmMEAPI ( ) : System

Upon the application form loading, the TTMarketExplorer is instantiated.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

Private Methods

Method Description
InitializeComponent ( ) : void

Required method for Designer support - do not modify the contents of this method with the code editor.

ReleaseProductEventHandlers ( ) : void

Unregister all the event handlers belonging to the products

aboutToolStripMenuItem_Click ( object sender, EventArgs e ) : void
btnReqestGateways_Click ( object sender, EventArgs e ) : void

Request gateways

lbGateways_SelectedIndexChanged ( object sender, EventArgs e ) : void

Gateway has been selected

lbProductTypes_SelectedIndexChanged ( object sender, EventArgs e ) : void

Product has been selected

mainWindow_FormClosed ( object sender, System.Windows.Forms.FormClosedEventArgs e ) : void
tvProductList_ItemDrag ( object sender, ItemDragEventArgs e ) : void

Contract has begun it's drag event

tvProductList_NodeMouseClick ( object sender, TreeNodeMouseClickEventArgs e ) : void

Save the parent when the child has been clicked - used to find the correct contract to drag

Method Details

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool true if managed resources should be disposed; otherwise, false.
return void

OnContracts() public method

TT Gateways deliver a list of contracts associated with the product
public OnContracts ( ITTGateway Gateway, ITTProduct Product, ITTContractCollection contracts ) : void
Gateway ITTGateway TT Gateway on which the product contracts trade
Product ITTProduct Product associated with the contracts
contracts ITTContractCollection Collection of the contracts available for the product
return void

OnGateway() public method

TT Gateways are found in response to a RequestGateways method call or when TT Gateways become available.
public OnGateway ( ITTGateway Gateway ) : void
Gateway ITTGateway The TT Gateway object found by the MEAPI
return void

OnGatewayAttributes() public method

MEAPI recieves the gateway attribute list (GAL settings) for the TT Gateway.
public OnGatewayAttributes ( ITTGateway Gateway, string attributeList, enumServiceType service ) : void
Gateway ITTGateway TT Gateway whose GAL settings changed
attributeList string Comma-separated list of GAL name-value pairs
service enumServiceType Service that started or restarted
return void

OnNewContract() public method

TT Gateways add new contracts for a product
public OnNewContract ( ITTGateway Gateway, ITTProduct Product, ITTContractInfo contractInfo ) : void
Gateway ITTGateway TT Gateway on which the product was added
Product ITTProduct Product associated with the new contract
contractInfo ITTContractInfo New Contract
return void

OnNewProduct() public method

TT Gateway recieves new products from an exchange.
public OnNewProduct ( ITTGateway Gateway, ITTProduct Product ) : void
Gateway ITTGateway
Product ITTProduct
return void

OnProductTypes() public method

TT Gateways return a list of product types hosted on the TT Gateway
public OnProductTypes ( ITTGateway Gateway, object productTypes, object productTypesAsString ) : void
Gateway ITTGateway TT Gateway containing the product types
productTypes object Array of product type IDs
productTypesAsString object Array of product type names
return void

OnProducts() public method

TT Gateways return a list of products hosted on the TT Gateway
public OnProducts ( ITTGateway Gateway, ITTProductCollection Products ) : void
Gateway ITTGateway TT Gateway whose products are requested
Products ITTProductCollection Prodcut collection from the gateway
return void

OnProductsFound() public method

TT Gateways find products that match a product request
public OnProductsFound ( ITTGateway Gateway, ITTProductCollection Products ) : void
Gateway ITTGateway TT Gateway containing the products
Products ITTProductCollection Collection of products returned by the TT Gateway
return void

OnProductsNotFound() public method

TT Gateways find no products matching a product request or query.
public OnProductsNotFound ( ITTGateway Gateway ) : void
Gateway ITTGateway TT Gateway from which you requested products
return void

OnRequestContractsTimeout() public method

Contract download times out
public OnRequestContractsTimeout ( ITTGateway Gateway, ITTProduct Product ) : void
Gateway ITTGateway TT Gateway on which the contracts product trades
Product ITTProduct Product associated with the contract
return void

OnRequestProductsTimeout() public method

TT Gateways timeout on a product request
public OnRequestProductsTimeout ( ITTGateway Gateway ) : void
Gateway ITTGateway TT Gateway which timed out
return void

OnServerStatus() public method

Status of a TT Gateway server change
public OnServerStatus ( ITTGateway Gateway, enumServiceType service, int IsAvailable, int IsLoggedIn ) : void
Gateway ITTGateway Gateway affected by the server status change
service enumServiceType Service whose status changed.
IsAvailable int Current status of the service
IsLoggedIn int Current logged in status
return void

PublishGatewayName() public method

Add the gateway to the GUI
public PublishGatewayName ( string gatewayName ) : void
gatewayName string Gateway name
return void

PublishProductTypes() public method

Add the product types to the GUI
public PublishProductTypes ( string prodTypes, int prodIndices ) : void
prodTypes string Array of product types
prodIndices int Array of the product indices (current not used)
return void

PublishProducts() public method

Add the products to the GUI
public PublishProducts ( TreeNode prodNode ) : void
prodNode System.Windows.Forms.TreeNode Product TreeNode
return void

frmMEAPI() public method

Upon the application form loading, the TTMarketExplorer is instantiated.
public frmMEAPI ( ) : System
return System