Esempio n. 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();
        }
Esempio n. 2
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();
        }