#pragma once

namespace ncg {
	//Plugin descriptor
	ref class ncgPlugin {
	public:
		ncgPlugin(){}
		~ncgPlugin(){}
	
		System::String ^_dllclass;				//dllname.ncgBaseClass  The common class we call in all .dll files.
		System::String ^_nameSpace;				//name space of dll
		System::String ^_name;					//name of dll
		System::String ^_baseClass;				//base class (which should always be ncgBaseClass
		System::IO::FileInfo ^_file;			//actual file
		System::Reflection::Assembly ^_assm;	//pointer to loaded assembly(our dll)
		System::Type ^_type;					//assembly type
		Object ^_instance;						//Initialized instance of our base class.
	protected:

	private:

	};
	
	ref class ncgPluginManager
	{
	public:
		ncgPluginManager(void);
		
		
		void FindPlugins();		//Locate plugins in a folder
	
		System::Void SendKeyDown(System::Object^  sender, System::Windows::Forms::KeyEventArgs^  e);	//Route panel key strokes to .dll
		System::Void SendKeyUp(System::Object^  sender, System::Windows::Forms::KeyEventArgs^  e);		//Route panel key strokes to .dll
	
		System::Collections::Generic::List<ncgPlugin^> ^GetPluginList(){return %_pluginList;}	//Return plugin list
		
		void SetPluginFolder(System::String ^s){_sPluginFld = s;}	//Set plugin folder
		
		void LoadPlugin(System::String ^name);	
		void LoadPlugin(ncgPlugin^ plug);
	
		void LoadPlugins();							//Load all plugins found with folder search
	
		void SetPanel(System::Windows::Forms::Panel ^ptr){_mainPanel = ptr;}
		void SetMenu(System::Windows::Forms::MenuStrip ^ptr){_mainMenu = ptr;}

	protected:
		
	private:
		System::String ^_sPluginFld;									//Plugin folder
		System::Collections::Generic::List<ncgPlugin^> _pluginList;		//Plugin list

		System::Windows::Forms::Panel ^_mainPanel;
		System::Windows::Forms::MenuStrip ^_mainMenu;
	};
};
