private void CalcMethodCount() { if (InstrumentType == null) return; if (IsDia) { labelMethodNum.Text = 1.ToString(LocalizationHelper.CurrentCulture); return; } if (_recalcMethodCountStatus != RecalcMethodCountStatus.waiting || !IsHandleCreated) { _recalcMethodCountStatus = RecalcMethodCountStatus.pending; return; } var helper = new MessageBoxHelper(this, false); if (!ValidateSettings(helper) || comboInstrument.SelectedItem == null) { labelMethodNum.Text = string.Empty; return; } // ReSharper disable LocalizableElement labelMethodNum.Text = "..."; // Not L10N // ReSharper restore LocalizableElement _recalcMethodCountStatus = RecalcMethodCountStatus.running; var recalcMethodCount = new RecalcMethodCountCaller(RecalcMethodCount); string instrument = comboInstrument.SelectedItem.ToString(); recalcMethodCount.BeginInvoke(_exportProperties, instrument, _fileType, _document, null, null); }
private void UpdateMethodCount(int? methodCount) { labelMethodNum.Text = methodCount.HasValue ? methodCount.Value.ToString(LocalizationHelper.CurrentCulture) : string.Empty; var recalcMethodCountStatus = _recalcMethodCountStatus; _recalcMethodCountStatus = RecalcMethodCountStatus.waiting; if (recalcMethodCountStatus == RecalcMethodCountStatus.pending) CalcMethodCount(); }
protected override void OnHandleCreated(EventArgs e) { _recalcMethodCountStatus = RecalcMethodCountStatus.waiting; CalcMethodCount(); base.OnHandleCreated(e); }