mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 03:59:15 +08:00
28 lines
660 B
C#
28 lines
660 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Wox.Plugin.WebSearch.SuggestionSources
|
|
{
|
|
public abstract class SuggestionSource
|
|
{
|
|
public virtual string Domain { get; set; }
|
|
|
|
public abstract Task<List<string>> GetSuggestions(string query);
|
|
|
|
public static SuggestionSource GetSuggestionSource(string name)
|
|
{
|
|
switch (name.ToLower())
|
|
{
|
|
case "google":
|
|
return new Google();
|
|
|
|
case "baidu":
|
|
return new Baidu();
|
|
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
}
|