diff options
author | lbsa71 | 2007-10-30 09:05:31 +0000 |
---|---|---|
committer | lbsa71 | 2007-10-30 09:05:31 +0000 |
commit | 67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch) | |
tree | 20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | |
parent | * Deleted .user file (diff) | |
download | opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2 opensim-SC_OLD-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz |
* Optimized usings
* Shortened type references
* Removed redundant 'this' qualifier
Diffstat (limited to 'OpenSim/Framework/Configuration/XML/XmlConfiguration.cs')
-rw-r--r-- | OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs index 52db852..152dec5 100644 --- a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs +++ b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | |||
@@ -25,12 +25,11 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | |||
28 | using System; | 29 | using System; |
29 | using System.IO; | 30 | using System.IO; |
30 | using System.Xml; | 31 | using System.Xml; |
31 | 32 | ||
32 | using OpenSim.Framework; | ||
33 | |||
34 | namespace OpenSim.Framework.Configuration | 33 | namespace OpenSim.Framework.Configuration |
35 | { | 34 | { |
36 | public class XmlConfiguration : IGenericConfig | 35 | public class XmlConfiguration : IGenericConfig |
@@ -56,6 +55,7 @@ namespace OpenSim.Framework.Configuration | |||
56 | if (configNode.Name != "Config") | 55 | if (configNode.Name != "Config") |
57 | throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>"); | 56 | throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>"); |
58 | } | 57 | } |
58 | |||
59 | public void LoadData() | 59 | public void LoadData() |
60 | { | 60 | { |
61 | lock (this) | 61 | lock (this) |
@@ -81,7 +81,7 @@ namespace OpenSim.Framework.Configuration | |||
81 | 81 | ||
82 | if (createdFile) | 82 | if (createdFile) |
83 | { | 83 | { |
84 | this.Commit(); | 84 | Commit(); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | } | 87 | } |
@@ -93,12 +93,13 @@ namespace OpenSim.Framework.Configuration | |||
93 | 93 | ||
94 | LoadDataToClass(); | 94 | LoadDataToClass(); |
95 | } | 95 | } |
96 | |||
96 | public string GetAttribute(string attributeName) | 97 | public string GetAttribute(string attributeName) |
97 | { | 98 | { |
98 | string result = null; | 99 | string result = null; |
99 | if (configNode.Attributes[attributeName] != null) | 100 | if (configNode.Attributes[attributeName] != null) |
100 | { | 101 | { |
101 | result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value; | 102 | result = ((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value; |
102 | } | 103 | } |
103 | return result; | 104 | return result; |
104 | } | 105 | } |
@@ -107,7 +108,7 @@ namespace OpenSim.Framework.Configuration | |||
107 | { | 108 | { |
108 | if (configNode.Attributes[attributeName] != null) | 109 | if (configNode.Attributes[attributeName] != null) |
109 | { | 110 | { |
110 | ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; | 111 | ((XmlAttribute) configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; |
111 | } | 112 | } |
112 | else | 113 | else |
113 | { | 114 | { |
@@ -124,7 +125,7 @@ namespace OpenSim.Framework.Configuration | |||
124 | if (!Directory.Exists(Util.configDir())) | 125 | if (!Directory.Exists(Util.configDir())) |
125 | { | 126 | { |
126 | Directory.CreateDirectory(Util.configDir()); | 127 | Directory.CreateDirectory(Util.configDir()); |
127 | } | 128 | } |
128 | doc.Save(fileName); | 129 | doc.Save(fileName); |
129 | } | 130 | } |
130 | 131 | ||
@@ -134,6 +135,5 @@ namespace OpenSim.Framework.Configuration | |||
134 | rootNode = null; | 135 | rootNode = null; |
135 | doc = null; | 136 | doc = null; |
136 | } | 137 | } |
137 | |||
138 | } | 138 | } |
139 | } | 139 | } \ No newline at end of file |