-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSettings.cs
168 lines (161 loc) · 4.92 KB
/
Settings.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;
namespace SlimTimer
{
public delegate void SettingChangeHandler(string setting);
[Serializable]
public class SlimtimerSettings
{
public event SettingChangeHandler Changed;
private String username = "username";
private String password = "password";
private int idleTimeout = 5;
private bool fileComments = true;
private int minimumTime = 5;
private bool cleanupDuplicates = true;
private bool askIgnoreProject = true;
private string[] trackedProjects = new string[] { };
private string[] ignoredProjects = new string[] { };
//private string[] projectMap = new string[] { };
/// <summary>
/// Get and sets the password
/// </summary>
[Description("Slimtimer password."), DefaultValue("password")]
public String Password
{
get { return this.password; }
set
{
this.password = value;
FireChanged("password");
}
}
/// <summary>
/// Get and sets the username
/// </summary>
[Description("Slimtimer username."), DefaultValue("username")]
public String Username
{
get { return this.username; }
set
{
this.username = value;
FireChanged("username");
}
}
/// <summary>
/// Get and sets the idleTimeout
/// </summary>
[Description("Idle time in minutes."), DefaultValue(5)]
public int IdleTimeout
{
get { return this.idleTimeout; }
set
{
this.idleTimeout = value;
FireChanged("idleTimeout");
}
}
/// <summary>
/// Get and sets the fileComments
/// </summary>
[Description("Save the opened files in time entry comments."), DefaultValue(true)]
public bool FileComments
{
get { return this.fileComments; }
set
{
this.fileComments = value;
FireChanged("fileComments");
}
}
/// <summary>
/// Get and sets the minimumTime
/// </summary>
[Description("Minimum time to submit in seconds."), DefaultValue(5)]
public int MinimumTime
{
get { return this.minimumTime; }
set
{
this.minimumTime = value;
FireChanged("minimumTime");
}
}
/// <summary>
/// Get and sets the cleanupDuplicates
/// </summary>
[Description("Clean up duplicate projects on launch."), DefaultValue(true)]
public bool CleanupDuplicates
{
get { return this.cleanupDuplicates; }
set
{
this.cleanupDuplicates = value;
FireChanged("cleanupDuplicates");
}
}
/// <summary>
/// Get and sets the askIgnoreProject
/// </summary>
[Description("Ask about ignoring a previously unopened project."), DefaultValue(true)]
public bool AskIgnoreProject
{
get { return this.askIgnoreProject; }
set
{
this.askIgnoreProject = value;
FireChanged("askIgnoreProject");
}
}
/// <summary>
/// Get and sets the trackedProjects
/// </summary>
[DisplayName("Tracked Projects")]
public string[] TrackedProjects
{
get { return this.trackedProjects; }
set
{
this.trackedProjects = value;
FireChanged("trackedProjects");
}
}
/// <summary>
/// Get and sets the ignoredProjects
/// </summary>
[DisplayName("Ignored Projects")]
public string[] IgnoredProjects
{
get { return this.ignoredProjects; }
set
{
this.ignoredProjects = value;
FireChanged("ignoredProjects");
}
}
/*
/// <summary>
/// Get and sets the projectMap
/// </summary>
[DisplayName("Project Map")]
public string[] ProjectMap
{
get { return this.projectMap; }
set
{
this.projectMap = value;
FireChanged("projectMap");
}
}
*/
private void FireChanged(string setting)
{
if (Changed != null)
Changed(setting);
}
}
}