2016-05-04 04:18:26 +08:00
|
|
|
|
using System.IO;
|
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Newtonsoft.Json.Serialization;
|
2015-01-05 22:41:17 +08:00
|
|
|
|
|
2015-01-26 22:50:38 +08:00
|
|
|
|
namespace Wox.Plugin.WebSearch
|
2014-01-29 22:44:57 +08:00
|
|
|
|
{
|
|
|
|
|
public class WebSearch
|
|
|
|
|
{
|
2016-05-04 04:18:26 +08:00
|
|
|
|
public const string DefaultIcon = "web_search.png";
|
2014-01-29 22:44:57 +08:00
|
|
|
|
public string Title { get; set; }
|
2015-11-05 06:49:40 +08:00
|
|
|
|
public string ActionKeyword { get; set; }
|
2016-05-04 04:18:26 +08:00
|
|
|
|
[NotNull]
|
|
|
|
|
private string _icon = DefaultIcon;
|
|
|
|
|
|
|
|
|
|
[NotNull]
|
|
|
|
|
public string Icon
|
|
|
|
|
{
|
|
|
|
|
get { return _icon; }
|
|
|
|
|
set
|
|
|
|
|
{
|
2016-05-05 23:21:35 +08:00
|
|
|
|
_icon = value;
|
2016-05-07 10:55:09 +08:00
|
|
|
|
IconPath = Path.Combine(Main.PluginDirectory, Main.ImageDirectory, value);
|
2016-05-04 04:18:26 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-05-05 23:21:35 +08:00
|
|
|
|
|
2016-05-04 04:18:26 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// All icon should be put under Images directory
|
|
|
|
|
/// </summary>
|
|
|
|
|
[NotNull]
|
|
|
|
|
[JsonIgnore]
|
2016-05-05 23:21:35 +08:00
|
|
|
|
internal string IconPath { get; private set; } = Path.Combine
|
|
|
|
|
(
|
2016-05-07 10:55:09 +08:00
|
|
|
|
Main.PluginDirectory, Main.ImageDirectory, DefaultIcon
|
2016-05-05 23:21:35 +08:00
|
|
|
|
);
|
2016-05-04 04:18:26 +08:00
|
|
|
|
|
2014-01-29 22:44:57 +08:00
|
|
|
|
public string Url { get; set; }
|
|
|
|
|
public bool Enabled { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|