-
Notifications
You must be signed in to change notification settings - Fork 5
/
TrackOrFileInterval.cs
executable file
·42 lines (35 loc) · 1.18 KB
/
TrackOrFileInterval.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
using MarkAble2.Properties;
namespace MarkAble2
{
//this is just for convenience to fill combo box
public class TrackOrFileInterval
{
public int Interval = 1;
public TrackOrFileInterval(int interval)
{
Interval = interval;
}
public override string ToString()
{
if (Interval == 1)
return Resources.Each;
int rem100 = Interval%100;
if ((rem100 >= 11) && (rem100 <= 13))
{
return Resources.Every + " " + Interval.ToString() + Resources.Ordinal_th;
}
int rem10 = Interval%10;
switch (rem10)
{
case 1:
return Resources.Every + " " + Interval.ToString() + Resources.Ordinal_st;
case 2:
return Resources.Every + " " + Interval.ToString() + Resources.Ordinal_nd;
case 3:
return Resources.Every + " " + Interval.ToString() + Resources.Ordinal_rd;
default:
return Resources.Every + " " + Interval.ToString() + Resources.Ordinal_th;
}
}
}
}