History

Added support for GSF configuration files on Mono

ritchiecarroll committed 12 years ago

Commit 2bbd6cd1 parent ef6432e13 files · +615 −136Browse files

Showing the changes to Source/Libraries/GSF.Core/Configuration/CategorizedSettingsElementCollection.cs (1 of 13 files). Show all

Unified · Split

Source/Libraries/GSF.Core/Configuration/CategorizedSettingsElementCollection.cs+18−6
@@ -111,6 +111,7 @@ namespace GSF.Configuration · 110 unmodified lines
111111 base.BaseRemoveAt(index);
112112
113113 base.BaseAdd(index, value);
114+ Modified = true;
114115 }
115116 }
116117
@@ -137,23 +138,29 @@ namespace GSF.Configuration · 20 unmodified lines
137138 {
138139 get
139140 {
141+ // Add setting since it's not there
140142 if (ensureExistance && (object)base.BaseGet(name) == null)
141− {
142− // Add setting since it's not there.
143143 Add(name, string.Empty);
144− }
145144
146145 CategorizedSettingsElement setting = (CategorizedSettingsElement)base.BaseGet(name);
146+
147+ // Set the crypto key for the setting
147148 if ((object)setting != null)
148− {
149− // Set the crypto key for the setting.
150149 setting.SetCryptoKey(m_cryptoKey);
151− }
152150
153151 return setting;
154152 }
155153 }
156154
155+ internal bool Modified
156+ {
157+ set
158+ {
159+ if ((object)m_section != null)
160+ m_section.Modified = value;
161+ }
162+ }
163+
157164 #endregion
158165
159166 #region [ Methods ]
@@ -242,6 +249,7 @@ namespace GSF.Configuration · 82 unmodified lines
242249 setting.Category = this;
243250 setting.SetCryptoKey(m_cryptoKey);
244251 base.BaseAdd(setting);
252+ Modified = true;
245253 }
246254 }
247255
@@ -252,6 +260,7 @@ namespace GSF.Configuration · 4 unmodified lines
252260 public void Remove(string name)
253261 {
254262 base.BaseRemove(name);
263+ Modified = true;
255264 }
256265
257266 /// <summary>
@@ -263,6 +272,7 @@ namespace GSF.Configuration · 5 unmodified lines
263272 if (base.BaseIndexOf(setting) >= 0)
264273 {
265274 Remove(setting.Name);
275+ Modified = true;
266276 }
267277 }
268278
@@ -273,6 +283,7 @@ namespace GSF.Configuration · 4 unmodified lines
273283 public void RemoveAt(int index)
274284 {
275285 base.BaseRemoveAt(index);
286+ Modified = true;
276287 }
277288
278289 /// <summary>
@@ -281,6 +292,7 @@ namespace GSF.Configuration · 2 unmodified lines
281292 public void Clear()
282293 {
283294 base.BaseClear();
295+ Modified = true;
284296 }
285297
286298 /// <summary>

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t