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
111 base.BaseRemoveAt(index);111 base.BaseRemoveAt(index);
112 112
113 base.BaseAdd(index, value);113 base.BaseAdd(index, value);
114 Modified = true;
114 }115 }
115 }116 }
116 117
@@ -137,23 +138,29 @@ namespace GSF.Configuration · 20 unmodified lines
137 {138 {
138 get139 get
139 {140 {
141 // Add setting since it's not there
140 if (ensureExistance && (object)base.BaseGet(name) == null)142 if (ensureExistance && (object)base.BaseGet(name) == null)
141 {
142 // Add setting since it's not there.
143 Add(name, string.Empty);143 Add(name, string.Empty);
144 }
145 144
146 CategorizedSettingsElement setting = (CategorizedSettingsElement)base.BaseGet(name);145 CategorizedSettingsElement setting = (CategorizedSettingsElement)base.BaseGet(name);
146
147 // Set the crypto key for the setting
147 if ((object)setting != null)148 if ((object)setting != null)
148 {
149 // Set the crypto key for the setting.
150 setting.SetCryptoKey(m_cryptoKey);149 setting.SetCryptoKey(m_cryptoKey);
151 }
152 150
153 return setting;151 return setting;
154 }152 }
155 }153 }
156 154
155 internal bool Modified
156 {
157 set
158 {
159 if ((object)m_section != null)
160 m_section.Modified = value;
161 }
162 }
163
157 #endregion164 #endregion
158 165
159 #region [ Methods ]166 #region [ Methods ]
@@ -242,6 +249,7 @@ namespace GSF.Configuration · 82 unmodified lines
242 setting.Category = this;249 setting.Category = this;
243 setting.SetCryptoKey(m_cryptoKey);250 setting.SetCryptoKey(m_cryptoKey);
244 base.BaseAdd(setting);251 base.BaseAdd(setting);
252 Modified = true;
245 }253 }
246 }254 }
247 255
@@ -252,6 +260,7 @@ namespace GSF.Configuration · 4 unmodified lines
252 public void Remove(string name)260 public void Remove(string name)
253 {261 {
254 base.BaseRemove(name);262 base.BaseRemove(name);
263 Modified = true;
255 }264 }
256 265
257 /// <summary>266 /// <summary>
@@ -263,6 +272,7 @@ namespace GSF.Configuration · 5 unmodified lines
263 if (base.BaseIndexOf(setting) >= 0)272 if (base.BaseIndexOf(setting) >= 0)
264 {273 {
265 Remove(setting.Name);274 Remove(setting.Name);
275 Modified = true;
266 }276 }
267 }277 }
268 278
@@ -273,6 +283,7 @@ namespace GSF.Configuration · 4 unmodified lines
273 public void RemoveAt(int index)283 public void RemoveAt(int index)
274 {284 {
275 base.BaseRemoveAt(index);285 base.BaseRemoveAt(index);
286 Modified = true;
276 }287 }
277 288
278 /// <summary>289 /// <summary>
@@ -281,6 +292,7 @@ namespace GSF.Configuration · 2 unmodified lines
281 public void Clear()292 public void Clear()
282 {293 {
283 base.BaseClear();294 base.BaseClear();
295 Modified = true;
284 }296 }
285 297
286 /// <summary>298 /// <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