public void Dispose() { Log(LogLevel.Info, "Shutting down!"); File.WriteAllText("settings.json", JsonConvert.SerializeObject(config)); commandManager.Dispose(); if (CommandsManager.UserRoles != null && CommandsManager.UserRoles.Count > 0) { File.WriteAllText("permissions.json", JsonConvert.SerializeObject(CommandsManager.UserRoles)); } if (client != null) { client.Dispose(); } config = null; }
public void CleanUp() { MarkEndExecution(); if (COF != null) { COF.Dispose(); COF = null; } if (names != null) { names.Dispose(); names = null; } if (gridManager != null) { gridManager.Dispose(); gridManager = null; } if (rlv != null) { rlv.Dispose(); rlv = null; } if (client != null) { UnregisterClientEvents(client); } if (pluginManager != null) { pluginManager.Dispose(); pluginManager = null; } if (movement != null) { movement.Dispose(); movement = null; } if (commandsManager != null) { commandsManager.Dispose(); commandsManager = null; } if (ContextActionManager != null) { ContextActionManager.Dispose(); ContextActionManager = null; } if (mediaManager != null) { mediaManager.Dispose(); mediaManager = null; } if (state != null) { state.Dispose(); state = null; } if (netcom != null) { netcom.Dispose(); netcom = null; } if (mainForm != null) { mainForm.Load -= new EventHandler(mainForm_Load); } Logger.Log("METAboltInstance finished cleaning up.", Helpers.LogLevel.Debug); }
public void CleanUp() { MarkEndExecution(); if (COF != null) { COF.Dispose(); COF = null; } if (Names != null) { Names.Dispose(); Names = null; } if (GridManger != null) { GridManger.Dispose(); GridManger = null; } if (RLV != null) { RLV.Dispose(); RLV = null; } if (Client != null) { UnregisterClientEvents(Client); } if (PluginManager != null) { PluginManager.Dispose(); PluginManager = null; } if (Movement != null) { Movement.Dispose(); Movement = null; } if (CommandsManager != null) { CommandsManager.Dispose(); CommandsManager = null; } if (ContextActionManager != null) { ContextActionManager.Dispose(); ContextActionManager = null; } if (MediaManager != null) { MediaManager.Dispose(); MediaManager = null; } if (State != null) { State.Dispose(); State = null; } if (Netcom != null) { Netcom.Dispose(); Netcom = null; } if (MainForm != null) { MainForm.Load -= new EventHandler(mainForm_Load); } Logger.Log("RadegastInstance finished cleaning up.", Helpers.LogLevel.Debug); }