If you are upgrading from our previous .Net 2.0 T4API.20.dll file to the new .Net 4.0 T4API.40.dll file then below are a few notes regarding the conversion which may require some code changes:
API now requires Microsoft .Net Framework v4.0 client profile or greater to run.API filenames have changed.
You need to update your projects to reference:
- T4API.40.dll
- T4Definitions.40.dll
- T4ChartDataAPI.40.dll (if needed)
API file dependencies have changed. You need to include only the following files when deploying your application:
- T4API.40.dll
- T4Definitions.40.dll
- T4ChartDataAPI.40.dll
- T4Connection.40.dll
- T4Message.40.dll
- T4TraceListener.40.dll
- Zlib1.dll - Note: There are different versions of this file installed depending on whether your system is x64 or x86.
- System.Data.SQLite.40.DLL - Note: There are different versions of this file installed depending on whether your system is x64 or x86.
T4APIUtilities.20.dll has not been migrated to .Net 4.0 and will be removed when support for 2.0 ends.
App.Config changes
Trace listener filename has changed. You need to use T4TraceListener.40.dll now and update your app.config file to use:
<add name="ExampleTrace" type="T4.TraceListener.T4TraceListener, T4TraceListener.40" initializeData="T4Example\T4Example, 5" />
Method Changes
The following methods have changed:
- Host object constructor no longer has the psServerURL parameter.
- Order.SubmissionSpeed property has been changed to return the Order.Speed object containing submission speed details.
- Host.CheckPasswordComplexity added psUsername parameter.
- User.CheckPasswordComplexity added psUsername parameter.
- Accounts.AccountListComplete event now includes poAccounts parameter.
The following obsolete methods and properties have been removed:
- Order.RevisionSpeed
- Order.RevisionSpeed2
- Order.PullSpeed
- Order.PullSpeed2
- Order.SubmissionSpeed2 - use Order.SubmissionSpeed instead.
- OrderList.Pull - use Order.PullOrders instead.
- Contract.ContractMonths
- Contract.RequestMarketTradeVolumeData - use Contract.BeginRequestMarketTradeVolumeData instead.
- ContractMonth class removed.
- ContractMonthList class removed.
- ContractRelationList.Refresh
- Market.RequestChartData - use Market.BeginRequestChartData instead.
- Market.StrikePrice - use Market.Details instead.
- Market.StrikeDenominator
- Market.Inverted
- Market.InvertedDecimals
- Market.TickDir
- MarketList.StrikePrice
- Host.Heartbeat event.
- Support for News feed has been removed.
The following methods have been added:
- Exchange.Enabled property.
- Exchange.HasPermission property - whether the user has permission to see quotes for this exchange.
- Exchange.HasChartPermission property - whether the user has permission to see chart data for this exchange.
- ExchangeList.GetSortedList method - Returns an ArrayList containing all the exchanges sorted in the order they would be displayed in T4 frontend.
- Contract.Enabled property.
- ContractList.GetSortedList method - Returns an ArrayList containing all the contracts of that exchange sorted in the order they would be displayed in T4 frontend.
- ContractList.Exchange property - reference to the Exchange object for this contract.
- MarketList.GetSortedList method - Returns an ArrayList containing all the markets of that contract sorted in the order they would be displayed in T4 frontend.
- Market.Exchange property - reference to the Exchange object for this market.
- Market.Contract property - reference to the Contract object for this market.
Login Changes
Host.Connected and Disconnected events have been removed. Host.LoginFailure event is now raised with the LoginResult.UnexpectedDisconnected result when the API is disconnected from the server in place of the Disconnected event.
Added new Host.Login shared method that displays a login dialog to the user allowing them to enter their details. This dialog also handles password change and expiration on login. Note that as this method displays a dialog to the user it won't return until the user exits the dialog. If they cancel it then 'Nothing' will be returned from this method. If login succeeds then the Host object is returned. You will not receive LoginSuccess or LoginFailure events during initial login using this method as it will have been raised prior to the Host object being returned to you.
Added New Functionality
Added dialogs that can be displayed by an API application to achieve common UI tasks such as login, selecting an account or market:
- Added Host.Login shared method that displays a login dialog.
- Added Host.ChangePassword method that displays a dialog to the user allowing them to change their password.
- Added AccountList.AccountPicker method that displays a dialog allowing the user to select an account.
- Added AccountList.AccountPickerMulti method that displays a dialog allowing the user to select one or more accounts.
- Added MarketData.ContractPicker method that displays a dialog allowing the user to select a contract.
- Added MarketData.MarketPicker method that displays a dialog allowing the user to select a market.
- Added MarketData.MarketPickerMulti method that displays a dialog allowing the user to select one or more markets.
Added utility classes for retrieving Exchange, Contract and Market objects easier:
- ExchangeLoader - Give it the ExchangeID and it will fire an event when it is loaded.
- ContractLoader - Give it the ExchangeID and ContractID and it will fire an event when it is loaded.
- MarketLoader - Give it the ExchangeID, ContractID and MarketID and it will fire an event when it is loaded.