Example #1
0
 // Inserts data into the plugin instance on load, kicking off self-initialization in the process
 internal void Init(string name, IRCQueueBot q, ConnectionService cs, EventDispatcher disp) {
     _name = name;
     _q = q;
     _cs = cs;
     _disp = disp;
     SetupFilter();
 }
Example #2
0
 public PluginLoader(IRCQueueBot q, ConnectionService cs, EventDispatcher disp)
     : base(q)
 {
     _baseDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + Path.DirectorySeparatorChar;
     _asm = new Dictionary<string, Assembly>(StringComparer.InvariantCultureIgnoreCase);
     _cs = cs;
     _disp = disp;
 }
Example #3
0
        public void LoadServices()
        {
            _services = new List<Service>();
            _services.Add(new Logger(this)); // Must be loaded first - must not send out error log events
            // Exceptions may be thrown beyond this point to indicate errors during initialization
            var cs = new ConnectionService(this);
            var disp = new EventDispatcher(this);
            _services.Add(cs);
            _services.Add(disp);

            PluginLoader loader = new PluginLoader(this, cs, disp);
            var plugins = loader.GetPluginInstances();
            disp.InsertPlugins(plugins);
        }