forked from memo1195/L5K
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAlarm.cs
39 lines (35 loc) · 918 Bytes
/
Alarm.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace L5K
{
public struct Alarm
{
public static string AlarmInit {
get
{
return "\"# <Alarm[";
}
}
public string AlarmComment { get; private set; }
public int Index {
get
{
var index = AlarmComment.IndexOf(']');
var length = AlarmInit.Length - index;
return Int32.Parse(AlarmComment.Substring(AlarmInit.Length, --length));
}
set
{
string change = $"[{Index}]";
AlarmComment = AlarmComment.Replace(change, value.ToString());
}
}
public Alarm(string comment)
{
AlarmComment = comment;
}
}
}