diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/General/Util.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs index f3e2a01..f3a8c73 100644 --- a/OpenSim/Framework/General/Util.cs +++ b/OpenSim/Framework/General/Util.cs | |||
@@ -32,6 +32,8 @@ using System.Net; | |||
32 | using System.Text; | 32 | using System.Text; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | 34 | ||
35 | using Nini.Config; | ||
36 | |||
35 | namespace OpenSim.Framework.Utilities | 37 | namespace OpenSim.Framework.Utilities |
36 | { | 38 | { |
37 | public class Util | 39 | public class Util |
@@ -313,5 +315,28 @@ namespace OpenSim.Framework.Utilities | |||
313 | { | 315 | { |
314 | 316 | ||
315 | } | 317 | } |
318 | |||
319 | // Nini (config) related Methods | ||
320 | public static IConfigSource ConvertDataRowToXMLConfig(System.Data.DataRow row, string fileName) | ||
321 | { | ||
322 | if(!File.Exists(fileName)) | ||
323 | { | ||
324 | //create new file | ||
325 | } | ||
326 | XmlConfigSource config = new XmlConfigSource(fileName); | ||
327 | AddDataRowToConfig(config, row); | ||
328 | config.Save(); | ||
329 | |||
330 | return config; | ||
331 | } | ||
332 | |||
333 | public static void AddDataRowToConfig(IConfigSource config, System.Data.DataRow row) | ||
334 | { | ||
335 | config.Configs.Add((string)row[0]); | ||
336 | for (int i = 0; i < row.Table.Columns.Count; i++) | ||
337 | { | ||
338 | config.Configs[(string)row[0]].Set(row.Table.Columns[i].ColumnName, row[i]); | ||
339 | } | ||
340 | } | ||
316 | } | 341 | } |
317 | } | 342 | } |