Repository navigation
Expand file tree
/
Copy pathSettings.cs
More file actions
128 lines (117 loc) · 2.88 KB
/
Copy pathSettings.cs
File metadata and controls
128 lines (117 loc) · 2.88 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
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
using System;
using System.IO;
using System.Text;
using System.Collections;
using System.ComponentModel;
using System.Drawing.Design;
using System.Collections.Generic;
using System.Windows.Forms.Design;
using System.Windows.Forms;
using System.Xml.Serialization;
using PluginCore.Localization;
using PluginCore.Managers;
using PluginCore;
namespace LibraryDepot
{
public delegate void SettingChangeHandler(string setting);
/*public enum TimerCheckInterval
{
Never = 0,
Every30sec = 30000,
Every60sec = 60000,
Every2min = 120000,
Every5min = 300000
}*/
[Serializable]
public class Settings
{
public event SettingChangeHandler Changed;
const string DEFAULT_LIBRARY_PATH = "";
const string DEFAULT_SRC_PATH = "/src/";
const string DEFAULT_SWC_PATH = "/lib/";
//const TimerCheckInterval DEFAULT_TIMER = TimerCheckInterval.Never;
const bool DEFAULT_ENABLE_WATCHER = true;
private string __librarypath = DEFAULT_LIBRARY_PATH;
private string __srcpath = DEFAULT_SRC_PATH;
private string __swcpath = DEFAULT_SWC_PATH;
//private TimerCheckInterval __checktimer = DEFAULT_TIMER;
private bool __enablewatcher = DEFAULT_ENABLE_WATCHER;
/// <summary>
/// Get and sets the __librarypath
/// </summary>
[DisplayName("Library path")]
[DefaultValue(DEFAULT_LIBRARY_PATH)]
[Editor(typeof(FolderNameEditor), typeof(UITypeEditor))]
public string LibraryPath
{
get { return this.__librarypath; }
set
{
this.__librarypath = value;
FireChanged("LibraryPath");
}
}
/// <summary>
/// Get and sets the __srcpath
/// </summary>
[DisplayName("Src path")]
[DefaultValue(DEFAULT_SRC_PATH)]
public string SrcPath
{
get { return this.__srcpath; }
set
{
this.__srcpath = value;
FireChanged("SrcPath");
}
}
/// <summary>
/// Get and sets the __swcpath
/// </summary>
[DisplayName("Swc path")]
[DefaultValue(DEFAULT_SWC_PATH)]
public string SwcPath
{
get { return this.__swcpath; }
set
{
this.__swcpath = value;
FireChanged("SwcPath");
}
}
/// <summary>
/// Get and sets the __checktimer
/// </summary>
/*[DisplayName("Check library path")]
[DefaultValue(DEFAULT_TIMER)]
public TimerCheckInterval CheckTimer
{
get { return this.__checktimer; }
set
{
this.__checktimer = value;
FireChanged("CheckTimer");
}
}*/
/// <summary>
/// Get and sets the __checktimer
/// </summary>
[DisplayName("Enable library watcher")]
[DefaultValue(DEFAULT_ENABLE_WATCHER)]
public bool EnableWatcher
{
get { return this.__enablewatcher; }
set
{
this.__enablewatcher = value;
FireChanged("EnableWatcher");
}
}
[Browsable(false)]
private void FireChanged(string setting)
{
if (Changed != null)
Changed(setting);
}
}
}