-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMain.cs
42 lines (37 loc) · 1.29 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System.Collections.Generic;
using Flow.Launcher.Plugin;
namespace HelloWorldCSharp
{
public class Main : IPlugin, IPluginI18n
{
internal PluginInitContext Context;
public List<Result> Query(Query query)
{
var result = new Result
{
Title = "Hello World from CSharp",
SubTitle = $"Query: {query.Search}",
Action = c =>
{
Context.API.ShowMsg(Context.API.GetTranslation("plugin_helloworldcsharp_greet_title"),
Context.API.GetTranslation("plugin_helloworldcsharp_greet_subtitle"));
return true;
},
IcoPath = "Images/app.png"
};
return new List<Result> { result };
}
public void Init(PluginInitContext context)
{
Context = context;
}
public string GetTranslatedPluginTitle()
{
return Context.API.GetTranslation("plugin_helloworldcsharp_plugin_name");
}
public string GetTranslatedPluginDescription()
{
return Context.API.GetTranslation("plugin_helloworldcsharp_plugin_description");
}
}
}