Base class of a SmartDOM column written in a custom assembly. Derive from it, mark the class with SmartDomColumnAttribute, give it a public parameterless constructor and override OnDrawCell; the other hooks are optional.
More...
|
| virtual void | OnInitialize () |
| | Called when the column is attached to a SmartDOM (normally once per instance), after its saved settings were restored. Context is available from here on.
|
| |
| virtual void | OnInstrumentChanged () |
| | Called after the SmartDOM switched to another instrument: reset the accumulated data here.
|
| |
| virtual void | OnSettingsChanged () |
| | Called after the column settings changed (and once after OnInitialize).
|
| |
| virtual void | OnNewTrades (IReadOnlyList< MarketDataArg > trades) |
| | New trades of the instrument, oldest first. Do not keep the list: it belongs to this call.
|
| |
| virtual void | OnMarketDepthChanged (IReadOnlyList< MarketDataArg > levels) |
| | Changed order book levels (MarketDataArg.DataType is MarketDataType.Bid or MarketDataType.Ask; a zero volume removes the level). The current book is available through ISmartDomColumnContext.GetBidVolume, ISmartDomColumnContext.GetAskVolume and ISmartDomColumnContext.GetDepth.
|
| |
| virtual void | OnBestBidAskChanged (MarketDataArg bestPrice) |
| | The best bid or the best ask changed (MarketDataArg.DataType tells which).
|
| |
| virtual void | OnTimer () |
| | Called about ten times per second while the SmartDOM is visible.
|
| |
| virtual void | OnDrawHeader (RenderContext context, Rectangle bounds, string text) |
| | Draws the column header. The default implementation fills the header with the standard header background and draws text (the header set by the user) in its center.
|
| |
| virtual void | OnDrawColumn (RenderContext context, Rectangle bounds) |
| | Called once per frame before the cells are drawn, with the rectangle of the whole column (header included). Use it for drawings that span several rows.
|
| |
| abstract void | OnDrawCell (RenderContext context, SmartDomCell cell) |
| | Draws one cell. The platform has already filled the cell with the column background; draw the content within SmartDomCell.Bounds. Called for every visible row of every frame — keep it cheap.
|
| |
| virtual bool | OnCellClick (SmartDomCell cell, RenderControlMouseEventArgs e) |
| | The user clicked a cell of the column. Return true if the column handled the click (the SmartDOM then shows no context menu for a right click).
|
| |
| virtual void | OnDispose () |
| | The platform stops using this instance: the column was removed from the SmartDOM or its layout was replaced, the SmartDOM was closed (also when the workspace is switched or the platform exits), the column was stopped by an error, the tariff no longer allows custom columns, its settings were replaced as a whole, or the assembly was reloaded. Called exactly once for every instance whose constructor completed, even if OnInitialize was not reached or threw. Release what the column created (timers, files, subscriptions to your own services, native resources) here; no other method is called afterwards. An exception thrown here is logged and ignored.
|
| |
Base class of a SmartDOM column written in a custom assembly. Derive from it, mark the class with SmartDomColumnAttribute, give it a public parameterless constructor and override OnDrawCell; the other hooks are optional.
The platform never calls one column instance concurrently: data callbacks, the timer and the drawing are serialized, so the column needs no locks for its own fields. Data callbacks are delivered on a platform thread shortly after the data arrives (in arrival order), never on the thread of the data feed.
Public read/write properties are the column settings: they are shown in the column settings (use [Display] for names, groups and order, [Browsable(false)] to hide one) and saved with the workspace. OnSettingsChanged is called after the user changed them.
If an override throws, the platform logs the exception, releases the instance (OnDispose) and shows the error in the column header; changing one of the column settings or loading the layout again starts a new instance with the saved settings.
| virtual void ATAS.Indicators.SmartDom.SmartDomColumn.OnDispose |
( |
| ) |
|
|
protectedvirtual |
The platform stops using this instance: the column was removed from the SmartDOM or its layout was replaced, the SmartDOM was closed (also when the workspace is switched or the platform exits), the column was stopped by an error, the tariff no longer allows custom columns, its settings were replaced as a whole, or the assembly was reloaded. Called exactly once for every instance whose constructor completed, even if OnInitialize was not reached or threw. Release what the column created (timers, files, subscriptions to your own services, native resources) here; no other method is called afterwards. An exception thrown here is logged and ignored.