-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathSelectable.cs
More file actions
32 lines (27 loc) · 1.04 KB
/
Selectable.cs
File metadata and controls
32 lines (27 loc) · 1.04 KB
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
using RT.Json;
namespace KtaneWeb
{
sealed class Selectable
{
public char? Accel;
public string PropName;
public string HumanReadable;
public string HumanReadableFunction;
public string IconFunction;
public string UrlFunction;
public string ShowIconFunction;
public JsonDict ToJson()
{
var dict = new JsonDict();
// String
if (PropName != null) dict[nameof(PropName)] = PropName;
if (HumanReadable != null) dict[nameof(HumanReadable)] = HumanReadable;
// Functions
if (HumanReadableFunction != null) dict[nameof(HumanReadableFunction)] = new JsonRaw(HumanReadableFunction);
if (IconFunction != null) dict[nameof(IconFunction)] = new JsonRaw(IconFunction);
if (UrlFunction != null) dict[nameof(UrlFunction)] = new JsonRaw(UrlFunction);
if (ShowIconFunction != null) dict[nameof(ShowIconFunction)] = new JsonRaw(ShowIconFunction);
return dict;
}
}
}