add autocompletion for system names

This commit is contained in:
2021-07-09 14:40:27 +02:00
parent fca1e607ec
commit 14c14f7626
8 changed files with 175 additions and 71 deletions

View File

@@ -0,0 +1,23 @@
using System;
using System.Collections;
using AutoCompleteTextBox.Editors;
using NonaBGS.EDDB;
namespace NonaBGS.UI {
public class SystemSuggestionProvider : ISuggestionProvider {
private PopulatedSystems systems = null;
public SystemSuggestionProvider(PopulatedSystems systems) {
this.systems = systems;
}
public PopulatedSystems Data {
get => systems;
set => systems = value;
}
public IEnumerable GetSuggestions(string filter) {
return systems.SystemNamesByFilter(filter);
}
}
}