示例#1
0
        private void FormClosingHandler(object sender, FormClosingEventArgs e)
        {
            if (settings.IsClosing())
            {
                return;
            }

            if (editorCtrl.IsChanged())
            {
                e.Cancel = !VgcApis.Misc.UI.Confirm(I18N.DiscardUnsavedChanges);
            }
        }
示例#2
0
        void RecordStatSample()
        {
            if (!setting.isEnableStatistics ||
                !IsCoreRunning() ||
                setting.IsScreenLocked() ||
                setting.IsClosing() ||
                !isRecording.Install())
            {
                return;
            }

            try
            {
                var statsPort = coreStates.GetStatPort();
                if (statsPort > 0)
                {
                    var sample = v2rayCore.QueryStatsApi(statsPort);
                    coreStates.AddStatSample(sample);
                }
            }
            catch { }
            isRecording.Remove();
        }