CleanUp()

View as Markdown

Definition

Unregisters LinkControls (IInstrumentProvider) and calls Cleanup() on ICleanable controls on the NTTabPage. Override this to, e.g., unsubscribe from events or perform any other cleanup operations when the tab is closed.

When overriding Cleanup(), it is strongly recommended when you call base.Cleanup() which ensures any link controls are also unregistered. The base implementation will also handle cleaning up any controls which implement ICleanable: AccountSelector, AtmStrategySelector, InstrumentSelector, IntervalSelector, TifSelector.

Method Return Value

This method does not return a value.

Syntax

public override void Cleanup()

Parameters

This method does not accept any parameters.

Examples

1public override void Cleanup()
2{
3 // unregister from any custom events
4 Connection.ConnectionStatusUpdate -= OnConnectionStatusUpdate;
5
6 // a call to base.Cleanup() will loop through the visual tree looking for all ICleanable children
7 // i.e., AccountSelector, AtmStrategySelector, InstrumentSelector, IntervalSelector, TifSelector,
8 // as well as unregister any link control events
9
10 base.Cleanup();
11}