• 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

accountselector cleanup

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

    accountselector cleanup

    Hello, i am using an AccountSelector within an AddonBase and looking at the cleanup in handling the

    accountSelector.SelectionChanged & account.Selected.AccountItemUpdate

    components.

    For the AccountSelector in the help it mentions the cleanup() which disposes of the AccountSelector and to call NTTabPage.base.Cleanup()

    how does one do this within a class derived from AddonBase as i am not using and do not need a tab in my addon for this instance?

    Also within my OnWindowCreated( Window window) within Addon base - this is where i install my addon to an existing Window .. in this case checking for window as Chart.

    Now all this is working fine and i see OnWindowCreated() is called whenever a new NTWindow is created.

    Is there a method within the Addon framework which will be called whenever a new tab is created within an NTwindow ? can i get a notfication for this? ie onWindowTab() .. distinct from the addon tabs?

    thanks

    #2
    Hello soulfx,

    Below I am providing a link to an example script that demonstrates detecting when a tab is opened (added to the tab collection), closed (removed from the tab collection), selected (loaded), or unselected (unloaded).

    http://ninjatrader.com/support/forum...182#post502182

    I would recommend removing handlers from events when the TabCollection change event triggers as the tab is removed.

    If the addon does not have tabs, I would recommend removing the handlers in a handler added to the unloaded event of the NTWindow.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      at NTWindow derived classes is also a eventhandler called "Closed" available. I have put all my cleanups to this handler.
      Probably the Unloaded and the Closed handlers are fired at the same time when window is closing.

      Comment


        #4
        Thanks Chelsea, i did see this when searching forum. Given it is the chart tab collection changes i need not the addon - this gave me the insight to what i need and is working based on changes to the chart tab control.

        Thanks GoSPvC - it is the AddonBase that i am using and so i have been doing the cleanup of resources and handlers in the onWindowDestroyed() which seems to be working fine ; i just wondered if there was a better/ alternate place to cleanup given this is derived from AddonBase and thus a chart window instance and not an Addon NTWindow.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by pafhjkayfha, Today, 01:10 AM
        0 responses
        1 view
        0 likes
        Last Post pafhjkayfha  
        Started by BrandonT1292, 06-17-2019, 03:03 PM
        2 responses
        22 views
        0 likes
        Last Post thinarthrill  
        Started by cbentrikin, Yesterday, 07:46 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Marco  
        Started by dr0832, 01-04-2019, 10:34 AM
        7 responses
        143 views
        0 likes
        Last Post Lancer
        by Lancer
         
        Started by RedDuke, Yesterday, 06:14 PM
        0 responses
        5 views
        0 likes
        Last Post RedDuke
        by RedDuke
         
        Working...
        X