-
-
Notifications
You must be signed in to change notification settings - Fork 350
/
Copy pathPluginMetadata.cs
115 lines (105 loc) · 3.19 KB
/
PluginMetadata.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json.Serialization;
namespace Flow.Launcher.Plugin
{
public class PluginMetadata : BaseModel
{
private string _pluginDirectory;
/// <summary>
/// Unique ID of the plugin
/// </summary>
public string ID { get; set; }
/// <summary>
/// Name of the plugin
/// </summary>
public string Name { get; set; }
/// <summary>
/// Author of the plugin
/// </summary>
public string Author { get; set; }
/// <summary>
/// Plugin Version
/// </summary>
public string Version { get; set; }
/// <summary>
/// Programming Language of the plugin
/// </summary>
public string Language { get; set; }
/// <summary>
/// Description of the plugin
/// </summary>
public string Description { get; set; }
/// <summary>
/// Website of the plugin
/// </summary>
public string Website { get; set; }
/// <summary>
/// Whether the plugin is enabled
/// </summary>
public bool Disabled { get; set; }
/// <summary>
/// Executable file path of the plugin
/// </summary>
public string ExecuteFilePath { get; private set;}
/// <summary>
/// Plugin Specified Search Delay
/// </summary>
public int? SearchDelay { get; set; } = null;
/// <summary>
/// Executable file Name of the plugin
/// </summary>
public string ExecuteFileName { get; set; }
public string PluginDirectory
{
get { return _pluginDirectory; }
internal set
{
_pluginDirectory = value;
ExecuteFilePath = Path.Combine(value, ExecuteFileName);
IcoPath = Path.Combine(value, IcoPath);
}
}
/// <summary>
/// Action keyword of the plugin (Obsolete)
/// </summary>
public string ActionKeyword { get; set; }
/// <summary>
/// Action keywords of the plugin
/// </summary>
public List<string> ActionKeywords { get; set; }
/// <summary>
/// Icon path of the plugin
/// </summary>
public string IcoPath { get; set;}
/// <summary>
/// Metadata ToString
/// </summary>
/// <returns>Full Name of Plugin</returns>
public override string ToString()
{
return Name;
}
/// <summary>
/// Plugin Priority
/// </summary>
[JsonIgnore]
public int Priority { get; set; }
/// <summary>
/// Init time include both plugin load time and init time
/// </summary>
[JsonIgnore]
public long InitTime { get; set; }
/// <summary>
/// Plugin Average Query Time (Statistics)
/// </summary>
[JsonIgnore]
public long AvgQueryTime { get; set; }
/// <summary>
/// Plugin Query Count (Statistics)
/// </summary>
[JsonIgnore]
public int QueryCount { get; set; }
}
}