Zzz – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | using System; |
2 | using Newtonsoft.Json; |
||
3 | using Newtonsoft.Json.Converters; |
||
4 | |||
5 | namespace Zzz.Action |
||
6 | { |
||
7 | public class ZzzAction |
||
8 | { |
||
9 | #region Public Enums, Properties and Fields |
||
10 | |||
11 | [JsonConverter(typeof(StringEnumConverter))] |
||
12 | public Action Action { get; set; } |
||
13 | |||
14 | #endregion |
||
15 | |||
16 | #region Constructors, Destructors and Finalizers |
||
17 | |||
18 | public ZzzAction() |
||
19 | { |
||
20 | } |
||
21 | |||
22 | public ZzzAction(Action action) : this() |
||
23 | { |
||
24 | Action = action; |
||
25 | } |
||
26 | |||
27 | public ZzzAction(string action) : this() |
||
28 | { |
||
29 | if (!Enum.TryParse<Action>(action, out var sleepAction)) |
||
30 | { |
||
31 | return; |
||
32 | } |
||
33 | |||
34 | Action = sleepAction; |
||
35 | } |
||
36 | |||
37 | #endregion |
||
38 | } |
||
39 | } |