Two things:
First:
I’m looking into how to write an AddOn and for learning I’m using the NT8 help and the example AddOnFramework
// Will be called as a new NTWindow is created. It will be called in the thread of that window protected override void OnWindowCreated(Window window) { // We want to place our AddOn in the Control Center's menus ControlCenter cc = window as ControlCenter; if (cc == null) return; /* Determine we want to place our AddOn in the Control Center's "New" menu Other menus can be accessed via the control's "Automation ID". For example: toolsMenuItem, workspacesMenuItem, connectionsMenuItem, helpMenuItem. */ existingMenuItemInControlCenter = cc.FindFirst("ControlCenterMenuItemNew") as NTMenuItem; if (existingMenuItemInControlCenter == null) return;
When I imported AddOnFramework NT said that it detected a new AddOn and it then “installed” it. This example AddOnFramwork adds a menu item to the NT control center window:
I’m also assuming that the OnStateChange handler is called during this “discovery, load and install phase”.
// Same as other NS objects. However there's a difference: this event could be called in any thread protected override void OnStateChange() { if (State == State.SetDefaults) { Description = "Example AddOn demonstrating some of the framework's capabilities"; Name = "AddOn Framework"; } }
Second:
I’ve written on this forum previously about my use of the AddOns folder for “general” purpose code to support indicators and strategies
And I’ve concluded from that exchange that the AddOns folder is really not intended for general purpose code but rather just AddOns.
And now coming to my question..
It appears from studying this AddOn that NT may scan the AddOns folder and look for code to load. If it’s doing this it may try to load parts of my ninjascript support code in there.
Is this a possibility and is it a concern? If it is scanning, when does it do that? I've been adding items to that folder from within Visual Studio and they are not always necessarily ready to be run even if they compile. Could NT be trying to load and run code as I'm developing because it's in the AddOns folder?
Comment