aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Common/OpenSim.GenericConfig/Xml
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj93
-rw-r--r--Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build42
-rw-r--r--Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs35
-rw-r--r--Common/OpenSim.GenericConfig/Xml/XmlConfig.cs136
4 files changed, 0 insertions, 306 deletions
diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj
deleted file mode 100644
index df68722..0000000
--- a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.csproj
+++ /dev/null
@@ -1,93 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <ProjectType>Local</ProjectType>
4 <ProductVersion>8.0.50727</ProductVersion>
5 <SchemaVersion>2.0</SchemaVersion>
6 <ProjectGuid>{E88EF749-0000-0000-0000-000000000000}</ProjectGuid>
7 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
8 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
9 <ApplicationIcon></ApplicationIcon>
10 <AssemblyKeyContainerName>
11 </AssemblyKeyContainerName>
12 <AssemblyName>OpenSim.GenericConfig.Xml</AssemblyName>
13 <DefaultClientScript>JScript</DefaultClientScript>
14 <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
15 <DefaultTargetSchema>IE50</DefaultTargetSchema>
16 <DelaySign>false</DelaySign>
17 <OutputType>Library</OutputType>
18 <AppDesignerFolder></AppDesignerFolder>
19 <RootNamespace>OpenSim.GenericConfig.Xml</RootNamespace>
20 <StartupObject></StartupObject>
21 <FileUpgradeFlags>
22 </FileUpgradeFlags>
23 </PropertyGroup>
24 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
25 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
26 <BaseAddress>285212672</BaseAddress>
27 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
28 <ConfigurationOverrideFile>
29 </ConfigurationOverrideFile>
30 <DefineConstants>TRACE;DEBUG</DefineConstants>
31 <DocumentationFile></DocumentationFile>
32 <DebugSymbols>True</DebugSymbols>
33 <FileAlignment>4096</FileAlignment>
34 <Optimize>False</Optimize>
35 <OutputPath>..\..\..\bin\</OutputPath>
36 <RegisterForComInterop>False</RegisterForComInterop>
37 <RemoveIntegerChecks>False</RemoveIntegerChecks>
38 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
39 <WarningLevel>4</WarningLevel>
40 <NoWarn></NoWarn>
41 </PropertyGroup>
42 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
43 <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
44 <BaseAddress>285212672</BaseAddress>
45 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
46 <ConfigurationOverrideFile>
47 </ConfigurationOverrideFile>
48 <DefineConstants>TRACE</DefineConstants>
49 <DocumentationFile></DocumentationFile>
50 <DebugSymbols>False</DebugSymbols>
51 <FileAlignment>4096</FileAlignment>
52 <Optimize>True</Optimize>
53 <OutputPath>..\..\..\bin\</OutputPath>
54 <RegisterForComInterop>False</RegisterForComInterop>
55 <RemoveIntegerChecks>False</RemoveIntegerChecks>
56 <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
57 <WarningLevel>4</WarningLevel>
58 <NoWarn></NoWarn>
59 </PropertyGroup>
60 <ItemGroup>
61 <Reference Include="System" >
62 <HintPath>System.dll</HintPath>
63 <Private>False</Private>
64 </Reference>
65 <Reference Include="System.Xml" >
66 <HintPath>System.Xml.dll</HintPath>
67 <Private>False</Private>
68 </Reference>
69 </ItemGroup>
70 <ItemGroup>
71 <ProjectReference Include="..\..\OpenSim.Framework\OpenSim.Framework.csproj">
72 <Name>OpenSim.Framework</Name>
73 <Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
74 <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package>
75 <Private>False</Private>
76 </ProjectReference>
77 </ItemGroup>
78 <ItemGroup>
79 <Compile Include="XmlConfig.cs">
80 <SubType>Code</SubType>
81 </Compile>
82 <Compile Include="Properties\AssemblyInfo.cs">
83 <SubType>Code</SubType>
84 </Compile>
85 </ItemGroup>
86 <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
87 <PropertyGroup>
88 <PreBuildEvent>
89 </PreBuildEvent>
90 <PostBuildEvent>
91 </PostBuildEvent>
92 </PropertyGroup>
93</Project>
diff --git a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build b/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build
deleted file mode 100644
index 075ea7f..0000000
--- a/Common/OpenSim.GenericConfig/Xml/OpenSim.GenericConfig.Xml.dll.build
+++ /dev/null
@@ -1,42 +0,0 @@
1<?xml version="1.0" ?>
2<project name="OpenSim.GenericConfig.Xml" default="build">
3 <target name="build">
4 <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" />
5 <mkdir dir="${project::get-base-directory()}/${build.dir}" />
6 <copy todir="${project::get-base-directory()}/${build.dir}">
7 <fileset basedir="${project::get-base-directory()}">
8 </fileset>
9 </copy>
10 <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll">
11 <resources prefix="OpenSim.GenericConfig.Xml" dynamicprefix="true" >
12 </resources>
13 <sources failonempty="true">
14 <include name="XmlConfig.cs" />
15 <include name="Properties/AssemblyInfo.cs" />
16 </sources>
17 <references basedir="${project::get-base-directory()}">
18 <lib>
19 <include name="${project::get-base-directory()}" />
20 <include name="${project::get-base-directory()}/${build.dir}" />
21 </lib>
22 <include name="../../../bin/OpenSim.Framework.dll" />
23 <include name="System.dll" />
24 <include name="System.Xml.dll" />
25 </references>
26 </csc>
27 <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" />
28 <mkdir dir="${project::get-base-directory()}/../../../bin/"/>
29 <copy todir="${project::get-base-directory()}/../../../bin/">
30 <fileset basedir="${project::get-base-directory()}/${build.dir}/" >
31 <include name="*.dll"/>
32 <include name="*.exe"/>
33 </fileset>
34 </copy>
35 </target>
36 <target name="clean">
37 <delete dir="${bin.dir}" failonerror="false" />
38 <delete dir="${obj.dir}" failonerror="false" />
39 </target>
40 <target name="doc" description="Creates documentation.">
41 </target>
42</project>
diff --git a/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs b/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs
deleted file mode 100644
index de5f48d..0000000
--- a/Common/OpenSim.GenericConfig/Xml/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
1using System.Reflection;
2using System.Runtime.CompilerServices;
3using System.Runtime.InteropServices;
4
5// General Information about an assembly is controlled through the following
6// set of attributes. Change these attribute values to modify the information
7// associated with an assembly.
8[assembly: AssemblyTitle("OpenSim.GenericConfig")]
9[assembly: AssemblyDescription("")]
10[assembly: AssemblyConfiguration("")]
11[assembly: AssemblyCompany("")]
12[assembly: AssemblyProduct("OpenSim.GenericConfig")]
13[assembly: AssemblyCopyright("Copyright © 2007")]
14[assembly: AssemblyTrademark("")]
15[assembly: AssemblyCulture("")]
16
17// Setting ComVisible to false makes the types in this assembly not visible
18// to COM components. If you need to access a type in this assembly from
19// COM, set the ComVisible attribute to true on that type.
20[assembly: ComVisible(false)]
21
22// The following GUID is for the ID of the typelib if this project is exposed to COM
23[assembly: Guid("285a3047-f165-46c8-8767-b51428738a09")]
24
25// Version information for an assembly consists of the following four values:
26//
27// Major Version
28// Minor Version
29// Build Number
30// Revision
31//
32// You can specify all the values or you can default the Revision and Build Numbers
33// by using the '*' as shown below:
34[assembly: AssemblyVersion("1.0.0.0")]
35[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs b/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs
deleted file mode 100644
index 40c252f..0000000
--- a/Common/OpenSim.GenericConfig/Xml/XmlConfig.cs
+++ /dev/null
@@ -1,136 +0,0 @@
1/*
2* Copyright (c) Contributors, http://www.openmetaverse.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4*
5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission.
15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26*
27*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31using System.Xml;
32using OpenSim.Framework.Interfaces;
33
34namespace OpenSim.GenericConfig
35{
36 public class XmlConfig : IGenericConfig
37 {
38 private XmlDocument doc;
39 private XmlNode rootNode;
40 private XmlNode configNode;
41 private string fileName;
42 private bool createdFile = false;
43
44 public XmlConfig(string filename)
45 {
46 fileName = filename;
47 }
48
49 public void LoadData()
50 {
51 doc = new XmlDocument();
52 try
53 {
54 if (System.IO.File.Exists(fileName))
55 {
56 XmlTextReader reader = new XmlTextReader(fileName);
57 reader.WhitespaceHandling = WhitespaceHandling.None;
58 doc.Load(reader);
59 reader.Close();
60 }
61 else
62 {
63 createdFile = true;
64 rootNode = doc.CreateNode(XmlNodeType.Element, "Root", "");
65 doc.AppendChild(rootNode);
66 configNode = doc.CreateNode(XmlNodeType.Element, "Config", "");
67 rootNode.AppendChild(configNode);
68 }
69
70 }
71 catch (Exception e)
72 {
73 Console.WriteLine(e.Message);
74 return;
75 }
76 try
77 {
78 rootNode = doc.FirstChild;
79 if (rootNode.Name != "Root")
80 throw new Exception("Error: Invalid .xml File. Missing <Root>");
81
82 configNode = rootNode.FirstChild;
83 if (configNode.Name != "Config")
84 throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>");
85
86 }
87 catch (Exception e)
88 {
89 Console.WriteLine(e.Message);
90 }
91 if (createdFile)
92 {
93 this.Commit();
94 }
95 }
96
97 public string GetAttribute(string attributeName)
98 {
99 string result = "";
100 if (configNode.Attributes[attributeName] != null)
101 {
102 result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value;
103 }
104 return result;
105 }
106
107 public bool SetAttribute(string attributeName, string attributeValue)
108 {
109 if (configNode.Attributes[attributeName] != null)
110 {
111 ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue;
112 }
113 else
114 {
115 XmlAttribute attri;
116 attri = doc.CreateAttribute(attributeName);
117 attri.Value = attributeValue;
118 configNode.Attributes.Append(attri);
119 }
120 return true;
121 }
122
123 public void Commit()
124 {
125 doc.Save(fileName);
126 }
127
128 public void Close()
129 {
130 configNode = null;
131 rootNode = null;
132 doc = null;
133 }
134
135 }
136}