public async override Task<bool> ActionAsync(string action) { bool result = base.Action(action); if (result) { if (action == ACTION_IMPORT) { using (ImportForm dlg = new ImportForm(Core)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _users = dlg.SelectedUsers; _logTypes = dlg.SelectedLogTypes; _fromDate = dlg.DateFrom; _toDate = dlg.DateTo; if (_users != null && _users.Count > 0) { _errormessage = null; _apiLimit = -1; await PerformImport(); if (!string.IsNullOrEmpty(_errormessage)) { System.Windows.Forms.MessageBox.Show(_errormessage, Utils.LanguageSupport.Instance.GetTranslation(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR)), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } if (_apiLimit >= 0) { Utils.Dialogs.LiveAPICachesLeftForm.ShowMessage(_apiLimit, _apiLeft); } } } } } } return result; }
public async override Task <bool> ActionAsync(string action) { bool result = base.Action(action); if (result) { if (action == ACTION_IMPORT) { using (ImportForm dlg = new ImportForm(Core)) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { _users = dlg.SelectedUsers; _logTypes = dlg.SelectedLogTypes; _fromDate = dlg.DateFrom; _toDate = dlg.DateTo; if (_users != null && _users.Count > 0) { _errormessage = null; _apiLimit = -1; await PerformImport(); if (!string.IsNullOrEmpty(_errormessage)) { System.Windows.Forms.MessageBox.Show(_errormessage, Utils.LanguageSupport.Instance.GetTranslation(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR)), System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } if (_apiLimit >= 0) { Utils.Dialogs.LiveAPICachesLeftForm.ShowMessage(_apiLimit, _apiLeft); } } } } } } return(result); }