private void FormClosingHandler(object sender, FormClosingEventArgs e) { if (settings.IsClosing()) { return; } if (editorCtrl.IsChanged()) { e.Cancel = !VgcApis.Misc.UI.Confirm(I18N.DiscardUnsavedChanges); } }
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(); }