public List <history> get_history(Form form, ComboBox box, ui_info info, int custom_ui_idx) { if (!lw_to_history_exists_.ContainsKey(form)) { // needs rebuilding lw_to_history_exists_.Add(form, true); var old_sel = lw_to_history_.ContainsKey(form) && box.SelectedIndex >= 0 ? lw_to_history_[form][box.SelectedIndex] : null; if (!lw_to_history_.ContainsKey(form)) { lw_to_history_.Add(form, null); } lw_to_history_[form] = static_history_.ToList(); int guid_idx = lw_to_history_[form].FindIndex(x => x.guid == info.last_log_guid); if (guid_idx >= 0) { // care about the last log (show it last) var last = lw_to_history_[form][guid_idx]; lw_to_history_[form].RemoveAt(guid_idx); lw_to_history_[form].Add(last); } logger.Debug("recreating history combo for " + custom_ui_idx); update_history(box, lw_to_history_[form], old_sel); } return(lw_to_history_[form]); }
public void recreate_combo(Form form, ComboBox box, ui_info info, int custom_ui_idx) { lw_to_history_exists_.Remove(form); get_history(form, box, info, custom_ui_idx); }