public void OnChoicesChanged(object sender, ChoicesChangedEventArgs args) { if (_enabled) { OnChoicesChanged_Internal(sender, args); } }
private async void OnChoicesChanged_Internal(object sender, ChoicesChangedEventArgs args) { var choices = _provider.GetDraftChoices(); int count = 0; if (_prevChoices2 != null) { while (!ChoicesChanged(_prevChoices2, choices)) { await Task.Delay(100); choices = _provider.GetDraftChoices(); if (count > 100) { break; } count += 1; } } string choicesName = MakeChoicesString(choices); Log.Info("Choice changed. Choices: [" + choicesName + "]"); _prevChoices2 = choices; }