/// <summary> /// Delete service. /// </summary> /// <param name="serviceId">The service identifier.</param> public void DeleteService(long serviceId) { if (services.ContainsKey(serviceId)) { ModuleInstance service = services[serviceId]; Module module = moduleRepository.Get(serviceId); if (module.type == (int)ModuleType.Service && module.enabled == 1) { moduleRepository.DisableService(serviceId); service.Unload(); } moduleRepository.DeleteService(serviceId); } else { moduleRepository.DeleteService(serviceId); } }
protected void ReceivePostDisableApp(PacketHeader header, Connection connection, long appId) { // ######################################################################## // This method requires authentication. // If user is not authorized then send UnAuthorized and end method. if (!accountManager.Authorized(connection)) { TCPConnection.GetConnection(connection.ConnectionInfo).SendObject( PacketName.ReUnauthorized.ToString(), 1); return; } // ######################################################################## if (accountManager.Administrator(connection)) { moduleRepository.DisableService(appId); TCPConnection.GetConnection(connection.ConnectionInfo).SendObject( PacketName.ReUpdateAccountInformation.ToString(), GenericResponse.Success); } }