public CoreServSettings(VgcApis.Interfaces.ICoreServCtrl coreServ) : this() { var cs = coreServ.GetCoreStates(); index = cs.GetIndex(); mark = cs.GetMark(); remark = cs.GetRemark(); isAutorun = cs.IsAutoRun(); isUntrack = cs.IsUntrack(); isGlobalImport = cs.IsInjectGlobalImport(); isBypassCnSite = cs.IsInjectSkipCnSite(); inboundMode = cs.GetInboundType(); inboundAddress = cs.GetInboundAddr(); try { var ccfg = coreServ.GetConfiger(); var cfg = ccfg.GetConfig(); var json = JObject.Parse(cfg); var GetStr = Misc.Utils.GetStringByKeyHelper(json); serverName = GetStr("v2raygcon.alias"); serverDescription = GetStr("v2raygcon.description"); } catch { } }
public void LoadCoreServer(VgcApis.Interfaces.ICoreServCtrl coreServ) { this.coreServ = coreServ; VgcApis.Misc.UI.Invoke(() => { if (this.coreServ == null) { lbTitle.Visible = false; linkConfigEditor.Visible = true; return; } var title = coreServ.GetCoreStates().GetTitle(); lbTitle.Text = title; lbTitle.Visible = true; linkConfigEditor.Visible = false; var config = coreServ.GetConfiger().GetConfig(); this.veeConfigerUI1.FromCoreConfig(config); }); }
private void debugToolStripMenuItem_Click(object sender, EventArgs e) { var finalConfig = coreServCtrl.GetConfiger().GetFinalConfig(); WinForms.FormConfiger.ShowConfig(finalConfig.ToString(Formatting.Indented)); }
public string GetConfig() => coreServCtrl.GetConfiger().GetConfig();
public string GetConfig() => coreServCtrl?.GetConfiger()?.GetConfig() ?? "";