Below is the console output showing the sequence of invocations when I create a fresh chart, then add the indicator, then hit F5:
Initialize
Initialize
Initialize
Initialize
OnStartUp
OnBarUpdate
OnTermination // On the replay connection, this is missing.
Initialize
OnStartUp
OnBarUpdate
I am having trouble with abandoned resources. Particularly, an unsupported feature: custom tools in the ToolStrip. And in fact, that is particularly vexing: I am trying to explicitly remove these objects during initialization, but they still do not get removed from the ToolStrip. This is the code that is called from OnStartUp:
private void initializeToolStrip() { // TODO: In replay, the strip is being left behind even with a null check on the ninjaToolStrip field if (ninjaToolStrip != null) { ninjaToolStrip.Items.Remove(pcvToolStripSeparator); ninjaToolStrip.Items.Remove(pcvToolStripDropDownButton); } ninjaToolStrip = (ToolStrip) ChartControl.Controls.Find("tsrTool", false)[0]; ninjaToolStrip.Items.Remove(pcvToolStripSeparator); ninjaToolStrip.Items.Remove(pcvToolStripDropDownButton); pcvToolStripSeparator = new ToolStripSeparator(); pcvToolStripSeparator.Name = "pcvToolStripSeparator"; ninjaToolStrip.Items.Add(pcvToolStripSeparator); // Add other tools ...
In any case it seems inconsistent that OnTermination IS invoked on a live connection but not on Replay ...
Comment