示例#1
0
        public void Run(VgcApis.Interfaces.Services.IApiService api)
        {
            orgSysProxySetting = Libs.Sys.ProxySetter.GetProxySetting();

            Microsoft.Win32.SystemEvents.SessionEnding += SessionEndingHandler;

            FileLogger.Info("ProxySetter: remember current sys proxy settings");

            this.vgcApi = api;

            var vgcSetting  = api.GetSettingService();
            var vgcServer   = api.GetServersService();
            var vgcNotifier = api.GetNotifierService();

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

            // dependency injection
            setting.Run(vgcSetting);
            pacServer.Run(setting);

            serverTracker.OnSysProxyChanged += UpdateMenuItemCheckedStatHandler;
            serverTracker.Run(setting, pacServer, vgcServer, vgcNotifier);
        }
示例#2
0
        public void Run(VgcApis.Models.IServices.IApiService api)
        {
            orgSysProxySetting = Lib.Sys.ProxySetter.GetProxySetting();
            VgcApis.Libs.Sys.FileLogger.Info("ProxySetter: save sys proxy settings");

            this.vgcApi = api;

            var vgcSetting  = api.GetSettingService();
            var vgcServer   = api.GetServersService();
            var vgcNotifier = api.GetNotifierService();

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

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