Ejemplo n.º 1
0
        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 { }
        }
Ejemplo n.º 2
0
        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);
            });
        }
Ejemplo n.º 3
0
        private void debugToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var finalConfig = coreServCtrl.GetConfiger().GetFinalConfig();

            WinForms.FormConfiger.ShowConfig(finalConfig.ToString(Formatting.Indented));
        }
Ejemplo n.º 4
0
 public string GetConfig() => coreServCtrl.GetConfiger().GetConfig();
Ejemplo n.º 5
0
 public string GetConfig() => coreServCtrl?.GetConfiger()?.GetConfig() ?? "";