Example #1
0
        public FormMain(
            Services.PsSettings setting,
            Services.PacServer pacServer,
            Services.ServerTracker servTracker)
        {
            this.setting     = setting;
            this.pacServer   = pacServer;
            this.servTracker = servTracker;

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

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

            InitializeComponent();
        }
Example #2
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;
        }
Example #3
0
        public void Run(PsSettings setting)
        {
            this.setting = setting;

            this.pacGenerator = new Libs.Nets.PacGenerator();
            this.pacGenerator.Run();

            // let serverTracker handle this
            // Reload();
        }
Example #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();
        }
Example #5
0
        public static FormMain CreateForm(
            Services.PsSettings setting,
            Services.PacServer pacServer,
            Services.ServerTracker servTracker)
        {
            FormMain r = null;

            VgcApis.Misc.UI.Invoke(() =>
            {
                r = new FormMain(setting, pacServer, servTracker);
            });
            return(r);
        }
Example #6
0
        public TabPacCustomList(
            Services.PsSettings setting,

            RichTextBox rtboxWhiteList,
            RichTextBox rtboxBlackList)
        {
            this.setting = setting;

            // oldCustomPacList != customPacList
            oldCustomPacList = setting.GetCustomPacSetting();

            this.rtboxBlackList = rtboxBlackList;
            this.rtboxWhiteList = rtboxWhiteList;

            InitControls();
        }
Example #7
0
        public TabBasicSetting(
            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,

            CheckBox chkBaiscUseHotkey,
            CheckBox chkBaiscUseAlt,
            CheckBox chkBaiscUseShift,
            TextBox tboxBasicHotkeyStr)
        {
            this.setting     = setting;
            this.servTracker = servTracker;

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

            this.cboxBasicPacProtocol       = cboxBasicPacProtocol;
            this.cboxBasicSysProxyMode      = cboxBasicSysProxyMode;
            this.tboxBasicProxyPort         = tboxBasicProxyPort;
            this.tboxBaiscPacPort           = tboxBaiscPacPort;
            this.cboxBasicPacMode           = cboxBasicPacMode;
            this.tboxBasicCustomPacPath     = tboxBasicCustomPacPath;
            this.chkBasicAutoUpdateSysProxy = chkBasicAutoUpdateSysProxy;
            this.chkBasicPacAlwaysOn        = chkBasicPacAlwaysOn;
            this.chkBasicUseCustomPac       = chkBasicUseCustomPac;
            this.chkBaiscUseHotkey          = chkBaiscUseHotkey;
            this.chkBaiscUseAlt             = chkBaiscUseAlt;
            this.chkBaiscUseShift           = chkBaiscUseShift;
            this.tboxBasicHotkeyStr         = tboxBasicHotkeyStr;

            InitControls();

            BindEvents(btnBasicBrowseCustomPac);

            servTracker.OnSysProxyChanged += OnSysProxyChangeHandler;
        }
Example #8
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;
        }
Example #9
0
        public TabPacCustomList(
            Services.PsSettings setting,

            RichTextBox rtboxWhiteList,
            RichTextBox rtboxBlackList,

            Button btnSetSortWhitelist,
            Button btnSetSortBlacklist)
        {
            this.setting = setting;

            // oldCustomPacList != customPacList
            oldCustomPacList = setting.GetCustomPacSetting();

            this.rtboxBlackList      = rtboxBlackList;
            this.rtboxWhiteList      = rtboxWhiteList;
            this.btnSetSortWhitelist = btnSetSortWhitelist;
            this.btnSetSortBlacklist = btnSetSortBlacklist;

            InitControls();
            BindEvents();
        }
Example #10
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();
        }