public void TerminateCore()
 {
     if (Core != null)
     {
         Core.Disconnect();
         Core = null;
         if (ModuleManage != null)
         {
             foreach (BlackLight.Services.Modules.BlackLightModule tModule in ModuleManage.Modules)
             {
                 tModule.ModUnload();
             }
             while (ModuleManage.Modules.Count > 0)
             {
                 ModuleManage.Modules[0] = null;
                 ModuleManage.Modules.RemoveAt(0);
             }
             ModuleManage = null;
         }
         if (timerController != null)
         {
             timerController.Dispose();
             timerController = null;
         }
         if (_timerChecker != null)
         {
             _timerChecker.Abort();
             _timerChecker = null;
         }
         if (ConfigManager != null&& ConfigManager.Configuration != null)
         {
             ConfigManager.Configuration.Clear();
             ConfigManager.Configuration = null;
         }
         if (ConfigManager != null)
         {
             ConfigManager = null;
         }
         Core_LogMessage("ServicesDaemon", "TerminateCore()", BlackLight.Services.Error.Errors.DEBUG, "Core Terminated", "", "", "");
     }
     else
     {
         Core_LogMessage("ServicesDaemon", "TerminateCore()", BlackLight.Services.Error.Errors.DEBUG, "Core already terminated", "", "", "");
     }
 }
 public ServicesDaemon(BlackLight.Services.Error.Errors LogType)
 {
     this.LogType = LogType;
     Core = new ServicesCore();
     Core.OnConnect += new BlackLight.Services.Core.IRC.OnConnectEventHandler(Core_onConnect);
     Core.events.onClientConnect += new BlackLight.Services.Core.ServicesCore.ServicesEvents.onClientConnectEventHandler(Core_onClientConnect);
     Core.events.onServer += new BlackLight.Services.Core.ServicesCore.ServicesEvents.onServerEventHandler(Core_onServer);
     Core.events.onQuit += new BlackLight.Services.Core.ServicesCore.ServicesEvents.onQuitEventHandler(Core_onQuit);
     Core.events.onNick += new BlackLight.Services.Core.ServicesCore.ServicesEvents.onNickEventHandler(Core_onNick);
     Core.events.onJoin += new BlackLight.Services.Core.ServicesCore.ServicesEvents.onJoinEventHandler(Core_onJoin);
     Core.onDisconnect += new BlackLight.Services.Core.IRC.onDisconnectEventHandler(Core_onDisconnect);
     Core.events.LogMessage += new BlackLight.Services.Core.ServicesCore.ServicesEvents.LogMessageEventHandler(Core_LogMessage);
     //				//ModuleManage = new BlackLight.Services.Modules.ModuleManagement(this);
     ConfigManager = new BlackLight.Services.Config.ConfigHandler();
     //Timers = new BlackLight.Services.Timers.TimerList(this);
 }