public TrojanSettingManager(string SettingPath, InfoDispDelegate InfoDisp, NoticeDispDelegate NotiDisp, TrojanProcessManager Tpm) { infoDisp = InfoDisp; notiDisp = NotiDisp; infoDisp("Loading setting file", "LiSettMgmt"); SettPath = SettingPath; Setting = new TrojanSetting(); autosave = new Thread(AutoSave); autorestart = new Thread(AutoDetect); tpm = Tpm; }
public void LogicInit() { tcm = new TrojanConfigManager(LitrojanUtils.GetLocalPath("trojan.json"), UpdateTxtLogDisplay); tcm.LoadConfig(); tpm = new TrojanProcessManager(LitrojanUtils.GetLocalPath("trojan.exe"), UpdateTxtLogDisplay); tsm = new TrojanSettingManager(LitrojanUtils.GetLocalPath("settings.json"), UpdateTxtLogDisplay, UpdateNoticeDisplay, tpm); tsm.LoadSetting(); tnm = new TrojanNetworkManager(tcm.Config, UpdateNoticeDisplay); UpdateTheme(tsm.Setting.DarkUITheme); foreach (var i in panel1.Controls) { if (i is RadioButton rb && Enum.GetName(typeof(RunMode), tcm.Config.RunMode) == rb.Text) { rb.Checked = true; break; } } }