But the problem I ran into happens when the draw object is deleted. When it is deleted I also need to delete the XML data file associated with it. As best I can tell there is no supported way of knowing when a draw object has been deleted. If there is please enlighten me. Also I have not been able to determine what Button was clicked in the Draw Object Edit Window. Is that something that is supported?
So as a work around I thought of creating a list of the XML file names and compare it to a list of "DrawObjects".Tag. But NT does not agree.
I was using this code in State=State.Terminated since it is called when the following Events happen:
1) Keyboard Delete Key is Pressed
2) Draw Object Edit Window Cancel Button is Clicked
3) Draw Object Edit Window Apply Button is Clicked
4) Draw Object Edit Window OK Button is Clicked
The following code throws error: "The name 'DrawObjects' does not exist in the current context".
foreach(DrawingTool draw in DrawObjects)
{
if(draw is DrawingTools.MyCustomDrawTool)
{
NinjaTrader.Code.Output.Process(string.Format("tag {0}", draw.Tag), PrintTo.OutputTab1);
I am open to any suggestions on determining when a Draw Object is Deleted.
Thanks.
Comment