Beispiel #1
0
        public TabStatus(
            VgcApis.Models.IUtils vgcUtils,
            Services.PsSettings setting,
            Services.PacServer pacServer,

            Label lbPacServerStatus,
            Label lbPacUrl,
            Button btnRestart,
            Button btnStop,
            Button btnDebug,
            Button btnCopy,
            Button btnClearSysProxy)
        {
            this.vgcUtils  = vgcUtils;
            this.setting   = setting;
            this.pacServer = pacServer;

            BindControls(lbPacServerStatus, lbPacUrl);
            BindEvents(
                pacServer,
                btnRestart,
                btnStop,
                btnDebug,
                btnCopy,
                btnClearSysProxy);

            OnPacServerStateChangedHandler(null, EventArgs.Empty);

            pacServer.OnPACServerStateChanged += OnPacServerStateChangedHandler;
        }
Beispiel #2
0
 public void Run(VgcApis.IApi vgcApi)
 {
     vgcUtils     = vgcApi.GetVgcUtils();
     vgcServers   = vgcApi.GetVgcServersService();
     vgcSetting   = vgcApi.GetVgcSettingService();
     userSettings = LoadUserSettings();
 }
Beispiel #3
0
 public void Run(
     VgcApis.Models.IUtils vgcUtils,
     VgcApis.Models.ISettingService setting)
 {
     this.vgcUtils = vgcUtils;
     this.setting  = setting;
     userSettings  = LoadUserSettings();
 }
Beispiel #4
0
        public void Run(
            VgcApis.Models.IUtils vgcUtils,
            PsSettings setting)
        {
            this.vgcUtils = vgcUtils;
            this.setting  = setting;

            this.pacGenerator = new Lib.Nets.PacGenerator();
            this.pacGenerator.Run(vgcUtils);

            // let serverTracker handle this
            // Reload();
        }
Beispiel #5
0
        public void Run(
            VgcApis.Models.IUtils vgcUtils,
            PsSettings setting,
            PacServer pacServer,
            VgcApis.Models.IServersService servers)
        {
            this.vgcUtils  = vgcUtils;
            this.setting   = setting;
            this.pacServer = pacServer;
            this.servers   = servers;

            Restart();
        }
Beispiel #6
0
        public void Run(VgcApis.IApi api)
        {
            orgSysProxySetting = Lib.Sys.ProxySetter.GetProxySetting();
            this.vgcApi        = api;

            this.vgcUtils = api.GetVgcUtils();
            var vgcSetting = api.GetVgcSettingService();
            var vgcServer  = api.GetVgcServersService();

            pacServer     = new PacServer();
            setting       = new PsSettings();
            serverTracker = new ServerTracker();

            // dependency injection
            setting.Run(vgcUtils, vgcSetting);
            pacServer.Run(vgcUtils, setting);
            serverTracker.Run(vgcUtils, setting, pacServer, vgcServer);

            setting.DebugLog("call Luncher.run");
        }
Beispiel #7
0
        public TabBasicSetting(
            VgcApis.Models.IUtils vgcUtils,
            Services.PsSettings setting,
            Services.ServerTracker servTracker,

            ComboBox cboxBasicPacProtocol,
            ComboBox cboxBasicSysProxyMode,
            TextBox tboxBasicProxyPort,
            TextBox tboxBaiscPacPort,
            ComboBox cboxBasicPacMode,
            TextBox tboxBasicCustomPacPath,
            CheckBox chkBasicAutoUpdateSysProxy,
            CheckBox chkBasicPacAlwaysOn,
            CheckBox chkBasicUseCustomPac,
            Button btnBasicBrowseCustomPac)
        {
            this.vgcUtils    = vgcUtils;
            this.setting     = setting;
            this.servTracker = servTracker;

            basicSettings = setting.GetBasicSetting();
            oldSetting    = vgcUtils.SerializeObject(basicSettings);

            BindControls(
                cboxBasicPacProtocol,
                cboxBasicSysProxyMode,
                tboxBasicProxyPort,
                tboxBaiscPacPort,
                cboxBasicPacMode,
                tboxBasicCustomPacPath,
                chkBasicAutoUpdateSysProxy,
                chkBasicPacAlwaysOn,
                chkBasicUseCustomPac);

            InitControls();

            BindEvents(btnBasicBrowseCustomPac);

            servTracker.OnSysProxyChanged += OnSysProxyChangeHandler;
        }
Beispiel #8
0
        public FormMain(
            VgcApis.Models.IUtils vgcUtils,
            Services.PsSettings setting,
            Services.PacServer pacServer,
            Services.ServerTracker servTracker)
        {
            this.vgcUtils    = vgcUtils;
            this.setting     = setting;
            this.pacServer   = pacServer;
            this.servTracker = servTracker;

            this.FormClosing += (s, a) =>
            {
                var confirm = true;
                if (!setting.isCleaning && !this.formVGCPluginCtrl.IsOptionsSaved())
                {
                    confirm = vgcUtils.Confirm(I18N.ConfirmCloseWinWithoutSave);
                }

                if (confirm)
                {
                    ReleaseUpdateTimer();
                    formVGCPluginCtrl.Cleanup();
                }
                else
                {
                    a.Cancel = true;
                }
            };

            InitializeComponent();

#if DEBUG
            this.Icon = Properties.Resources.icon_light;
#else
            this.Icon = Properties.Resources.icon_dark;
#endif
            this.Show();
        }
Beispiel #9
0
 public void Run(VgcApis.Models.IUtils vgcUtils)
 {
     this.vgcUtils = vgcUtils;
 }