protected override void OnStart(string[] args)
        {
            if (File.Exists(Globals.WritableDirectoryBase + "History.json"))
            {
                string json;
                lock (LuaFileLock)
                    json = File.ReadAllText(Globals.WritableDirectoryBase + "History.json", ByteUtil.Utf8NoBOM);
                history = JsonConvert.DeserializeObject <History>(json);
            }
            else
            {
                history = new History();
            }

            if (!string.IsNullOrWhiteSpace(settings.luaFilePath) && File.Exists(settings.luaFilePath))
            {
                history.AddFromLuaString(File.ReadAllText(settings.luaFilePath));
            }

            if (settings.enableWebServer)
            {
                webServer = new WebServer(settings.httpPort);
                webServer.Start();
            }
            else
            {
                thrFileManagement = new Thread(fileManagement);
                thrFileManagement.IsBackground = false;
                thrFileManagement.Name         = "File Management";
                thrFileManagement.Start();
            }
        }