• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error CS0115 on Dispose()

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • aligator
    started a topic Error CS0115 on Dispose()

    Error CS0115 on Dispose()

    Dear Support,

    I am converting a timer indicator to NT8 and on compile getting Error CS115 on trying to override Dispose() in the following code:

    Code:
          public override void Dispose()
            {
                if (timer != null)
                {
                    timer.Enabled = false;
                    timer = null;
                }
               base.Dispose();
            }
    Unfortunately, Error CS0115 (no suitable method found to override) is not documented and the code breaking has very little detail.

    Any idea to resolve this error is appreciated.

    Many thanks.

  • NinjaTrader_ChelseaB
    replied
    Hello aligator,

    Overriding the Plot method and custom rendering with the graphics library is not supported for NinjaTrader 7 and is not documented.

    Because of this, there are no code breaking changes documented as this was never supported for NinjaTrader 7.

    Rendering is now supported for NinjaTrader 8 and done in OnRender().
    http://ninjatrader.com/support/helpG.../rendering.htm
    http://ninjatrader.com/support/helpG..._reference.htm

    Leave a comment:


  • aligator
    replied
    Originally posted by NinjaTrader_Jesse View Post
    Hello,

    Thank you for the inquiry.

    It looks like this override didn't make it into the code breaking changes guide, you would need to utilize the Terminated state in NT8 for cleanup instead.

    http://ninjatrader.com/support/helpG...=onstatechange

    As terminated gets called for menu instances where your timer may not have been created or started, you may additionally need to check for null in this state just as you already are:

    Code:
    else if(State == State.Terminated)
    {
         if (timer != null)
         {
              timer.Stop();
              timer.Enabled = false;
              timer = null;
         }
    }
    I look forward to being of further assistance.
    Thank you jesse,

    The implementation took care of the only error that I had but now generates a few new errors related to "graphics.DrawString()" for which I see no code breaking information.

    Please see the block of script under "on render" as related to "graphics" in the attached file, specially lines 113 -130 area.

    Many thanks.
    Attached Files

    Leave a comment:


  • NinjaTrader_Jesse
    replied
    Hello,

    Thank you for the inquiry.

    It looks like this override didn't make it into the code breaking changes guide, you would need to utilize the Terminated state in NT8 for cleanup instead.

    http://ninjatrader.com/support/helpG...=onstatechange

    As terminated gets called for menu instances where your timer may not have been created or started, you may additionally need to check for null in this state just as you already are:

    Code:
    else if(State == State.Terminated)
    {
         if (timer != null)
         {
              timer.Stop();
              timer.Enabled = false;
              timer = null;
         }
    }
    I look forward to being of further assistance.

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by XimoTrader, Today, 12:57 PM
1 response
7 views
0 likes
Last Post NinjaTrader_PatrickG  
Started by FxInception, Today, 12:27 PM
2 responses
10 views
0 likes
Last Post FxInception  
Started by siroya, Today, 10:34 AM
1 response
20 views
0 likes
Last Post NinjaTrader_ShawnB  
Started by Leeroy_Jenkins, Today, 11:22 AM
2 responses
12 views
0 likes
Last Post Leeroy_Jenkins  
Started by RedDuke, Today, 10:27 AM
2 responses
15 views
0 likes
Last Post RedDuke
by RedDuke
 
Working...
X