* Rex merge, random bits and pieces
* Prebuild merged really badly - I think this may need some manual fixing yet.afrisby-3
parent
712b43ad2e
commit
b8b18356e6
138
CONTRIBUTORS.txt
138
CONTRIBUTORS.txt
|
@ -1,59 +1,79 @@
|
|||
The following people have contributed to OpenSim (Thank you
|
||||
for your effort!)
|
||||
|
||||
Add your name in here if you have committed to OpenSim
|
||||
|
||||
OpenSim Developers
|
||||
|
||||
* MW
|
||||
* Adam Frisby (DeepThink Pty Ltd)
|
||||
* MingChen (DeepThink Pty Ltd)
|
||||
* lbsa71 (Tribal Media AB)
|
||||
* sdague (International Business Machines Corp.)
|
||||
* Andy-
|
||||
* Gareth
|
||||
* MorphW
|
||||
* CW
|
||||
* Babblefrog
|
||||
* Tedd
|
||||
* justincc (International Business Machines Corp.)
|
||||
* Teravus (w3z)
|
||||
* Johan Berntsson (3Di)
|
||||
|
||||
Patches
|
||||
|
||||
* Alondria
|
||||
* BigFootAg
|
||||
* CharlieO
|
||||
* Danx0r
|
||||
* Dalien
|
||||
* Darok
|
||||
* jhurliman (LLSD Login)
|
||||
|
||||
LSL Devs
|
||||
|
||||
* Alondria
|
||||
* CharlieO
|
||||
* Tedd
|
||||
|
||||
Testers
|
||||
|
||||
* Ckrinke
|
||||
* CharlieO (LSL)
|
||||
|
||||
|
||||
This software uses components from the following developers:
|
||||
* Sleepycat Software (Berkeley DB)
|
||||
* DB4objects, Inc. (DB4o)
|
||||
* SQLite (Public Domain)
|
||||
* XmlRpcCS (http://xmlrpccs.sf.net/)
|
||||
* MySQL, Inc. (MySQL Connector/NET)
|
||||
* AGEIA Inc. (PhysX)
|
||||
* Russel L. Smith (ODE)
|
||||
* Prebuild ( http://sourceforge.net/projects/dnpb/ )
|
||||
* LibSecondLife ( http://www.libsecondlife.org/wiki/Main_Page )
|
||||
|
||||
In addition, we would like to thank:
|
||||
* The Mono Project
|
||||
* The NANT Developers
|
||||
* Microsoft (.NET, MSSQL-Adapters)
|
||||
The following people have contributed to OpenSim (Thank you
|
||||
for your effort!)
|
||||
|
||||
Add your name in here if you have committed to OpenSim
|
||||
|
||||
|
||||
OpenSim Developers
|
||||
|
||||
* MW (Tribal Media AB)
|
||||
* Adam Frisby (DeepThink Pty Ltd)
|
||||
* MingChen (DeepThink Pty Ltd)
|
||||
* lbsa71 (Tribal Media AB)
|
||||
* sdague (International Business Machines Corp.)
|
||||
* Andy-
|
||||
* Gareth
|
||||
* MorphW
|
||||
* CW
|
||||
* Babblefrog
|
||||
* Tedd
|
||||
* justincc (International Business Machines Corp.)
|
||||
* Teravus (w3z)
|
||||
* Johan Berntsson (3Di)
|
||||
* Ckrinke (Charles Krinke)
|
||||
* Danx0r
|
||||
* Dalien
|
||||
* Darok
|
||||
* chi11ken (3Di)
|
||||
* adjohn (3Di)
|
||||
* Alondria
|
||||
|
||||
|
||||
Patches
|
||||
|
||||
* BigFootAg
|
||||
* CharlieO
|
||||
* jhurliman (LLSD Login)
|
||||
* kinoc
|
||||
* daTwitch
|
||||
* mikkopa/_someone - RealXtend
|
||||
* openlifegrid.com
|
||||
* Dr Scofield (International Business Machines Corp.)
|
||||
* Daedius
|
||||
* alex_carnell
|
||||
* webmage (International Business Machines Corp.)
|
||||
* jimbo2120 (International Business Machines Corp.)
|
||||
* brianw/Sir_Ahzz
|
||||
* ChrisDown
|
||||
|
||||
|
||||
LSL Devs
|
||||
|
||||
* Alondria
|
||||
* CharlieO
|
||||
* Tedd
|
||||
|
||||
|
||||
Testers
|
||||
|
||||
* Ckrinke
|
||||
* CharlieO (LSL)
|
||||
* openlifegrid.com
|
||||
|
||||
|
||||
This software uses components from the following developers:
|
||||
* Sleepycat Software (Berkeley DB)
|
||||
* DB4objects, Inc. (DB4o)
|
||||
* SQLite (Public Domain)
|
||||
* XmlRpcCS (http://xmlrpccs.sf.net/)
|
||||
* MySQL, Inc. (MySQL Connector/NET)
|
||||
* AGEIA Inc. (PhysX)
|
||||
* Russel L. Smith (ODE)
|
||||
* Prebuild ( http://sourceforge.net/projects/dnpb/ )
|
||||
* LibSecondLife ( http://www.libsecondlife.org/wiki/Main_Page )
|
||||
|
||||
|
||||
In addition, we would like to thank:
|
||||
* The Mono Project
|
||||
* The NANT Developers
|
||||
* Microsoft (.NET, MSSQL-Adapters)
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
Copyright (c) Contributors, http://opensimulator.org/
|
||||
See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the OpenSim Project nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
|
||||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
File diff suppressed because it is too large
Load Diff
|
@ -1,261 +1,261 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
|
||||
xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com), David Hudson (jendave at yahoo dot com)
|
||||
|
||||
.NET Prebuild is a cross-platform XML-driven pre-build tool which
|
||||
allows developers to easily generate project or make files for major
|
||||
IDE's and .NET development tools including: Visual Studio .NET 2002 and
|
||||
2003, SharpDevelop, MonoDevelop, and NAnt.
|
||||
|
||||
BSD License:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
|
||||
and the following disclaimer in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* The name of the author may not be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:element name="Prebuild">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="version" />
|
||||
<xs:attribute name="checkOsVars" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Process" type="xs:string" />
|
||||
<xs:element name="Solution">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Options" minOccurs="0" />
|
||||
<xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
|
||||
<xs:element ref="Files" minOccurs="0" />
|
||||
<xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="activeConfig" type="xs:string" default="Debug" />
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd"
|
||||
xmlns="http://dnpb.sourceforge.net/schemas/prebuild-1.7.xsd">
|
||||
<xs:annotation>
|
||||
<xs:documentation>
|
||||
Copyright (c) 2004-2005 Matthew Holmes (calefaction at houston . rr . com), Dan Moorehead (dan05a at gmail . com), David Hudson (jendave at yahoo dot com)
|
||||
|
||||
.NET Prebuild is a cross-platform XML-driven pre-build tool which
|
||||
allows developers to easily generate project or make files for major
|
||||
IDE's and .NET development tools including: Visual Studio .NET 2002 and
|
||||
2003, SharpDevelop, MonoDevelop, and NAnt.
|
||||
|
||||
BSD License:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted
|
||||
provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this list of conditions
|
||||
and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
|
||||
and the following disclaimer in the documentation and/or other materials provided with the
|
||||
distribution.
|
||||
* The name of the author may not be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:element name="Prebuild">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Process" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element ref="Solution" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="version" />
|
||||
<xs:attribute name="checkOsVars" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Process" type="xs:string" />
|
||||
<xs:element name="Solution">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Options" minOccurs="0" />
|
||||
<xs:element ref="Configuration" minOccurs="1" maxOccurs="unbounded" />
|
||||
<xs:element ref="Files" minOccurs="0" />
|
||||
<xs:element ref="Project" minOccurs="1" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="activeConfig" type="xs:string" default="Debug" />
|
||||
<xs:attribute name="path" type="xs:string" default="" />
|
||||
<xs:attribute name="version" type="xs:string" default="1.0.0" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Project">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="path" type="xs:string" />
|
||||
<xs:attribute name="localCopy" type="xs:boolean" />
|
||||
<xs:attribute name="version" type="xs:string" default="1.0.0"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element ref="Files" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="designerFolder" type="xs:string" default="" />
|
||||
<xs:attribute name="filterGroups" type="xs:string" default="" />
|
||||
<xs:attribute name="path" type="xs:string" default="" />
|
||||
<xs:attribute name="icon" type="xs:string" default="" />
|
||||
<xs:attribute name="language" default="C#">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="C#" />
|
||||
<xs:enumeration value="VB.NET" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="type" default="Exe">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Exe" />
|
||||
<xs:enumeration value="WinExe" />
|
||||
<xs:enumeration value="Library" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="runtime" default="Microsoft">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Microsoft" />
|
||||
<xs:enumeration value="Mono" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="startupObject" type="xs:string" default="" />
|
||||
<xs:attribute name="rootNamespace" type="xs:string" />
|
||||
<xs:attribute name="assemblyName" type="xs:string" />
|
||||
<xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Configuration">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Options" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Options">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="OnBuildSuccess" />
|
||||
<xs:enumeration value="Always" />
|
||||
<xs:enumeration value="OnOutputUpdated" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="RunScript" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="WarningLevel" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer">
|
||||
<xs:minInclusive value="0" />
|
||||
<xs:maxInclusive value="4" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="OutputPath" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="GenerateDocumentation" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
|
||||
<xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="KeyFile" type="xs:string" minOccurs="0" />
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Files">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="File">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="resourceName" type="xs:string" default="" />
|
||||
<xs:attribute name="buildAction" default="Compile">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="None" />
|
||||
<xs:enumeration value="Compile" />
|
||||
<xs:enumeration value="Content" />
|
||||
<xs:enumeration value="EmbeddedResource" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="subType" default="Code">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Code" />
|
||||
<xs:enumeration value="Component" />
|
||||
<xs:enumeration value="Form" />
|
||||
<xs:enumeration value="Settings" />
|
||||
<xs:enumeration value="UserControl" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="link" type="xs:boolean" />
|
||||
<xs:attribute name="copyToOutput" default="Never">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Never" />
|
||||
<xs:enumeration value="Always" />
|
||||
<xs:enumeration value="PreserveNewest" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Match">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Exclude" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="path" type="xs:string" />
|
||||
<xs:attribute name="pattern" type="xs:string" use="required" />
|
||||
<xs:attribute name="recurse" type="xs:boolean" default="false" />
|
||||
<xs:attribute name="useRegex" type="xs:boolean" default="false" />
|
||||
<xs:attribute name="buildAction" default="Compile">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="None" />
|
||||
<xs:enumeration value="Compile" />
|
||||
<xs:enumeration value="Content" />
|
||||
<xs:enumeration value="EmbeddedResource" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="resourceName" type="xs:string" default="" />
|
||||
<xs:attribute name="subType" default="Code">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Code" />
|
||||
<xs:enumeration value="Component" />
|
||||
<xs:enumeration value="Designer" />
|
||||
<xs:enumeration value="Form" />
|
||||
<xs:enumeration value="Settings" />
|
||||
<xs:enumeration value="UserControl" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="link" type="xs:boolean" />
|
||||
<xs:attribute name="copyToOutput" default="Never">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Never" />
|
||||
<xs:enumeration value="Always" />
|
||||
<xs:enumeration value="PreserveNewest" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Exclude">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
<xs:attribute name="version" type="xs:string" default="1.0.0" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Project">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Configuration" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="ReferencePath" type="xs:string" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element name="Reference" minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="path" type="xs:string" />
|
||||
<xs:attribute name="localCopy" type="xs:boolean" />
|
||||
<xs:attribute name="version" type="xs:string" default="1.0.0"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element ref="Files" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
<xs:attribute name="designerFolder" type="xs:string" default="" />
|
||||
<xs:attribute name="filterGroups" type="xs:string" default="" />
|
||||
<xs:attribute name="path" type="xs:string" default="" />
|
||||
<xs:attribute name="icon" type="xs:string" default="" />
|
||||
<xs:attribute name="language" default="C#">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="C#" />
|
||||
<xs:enumeration value="VB.NET" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="type" default="Exe">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Exe" />
|
||||
<xs:enumeration value="WinExe" />
|
||||
<xs:enumeration value="Library" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="runtime" default="Microsoft">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Microsoft" />
|
||||
<xs:enumeration value="Mono" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="startupObject" type="xs:string" default="" />
|
||||
<xs:attribute name="rootNamespace" type="xs:string" />
|
||||
<xs:attribute name="assemblyName" type="xs:string" />
|
||||
<xs:attribute name="generateAssemblyInfoFile" type="xs:boolean" default="false"/>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Configuration">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Options" minOccurs="0" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Options">
|
||||
<xs:complexType>
|
||||
<xs:all>
|
||||
<xs:element name="CompilerDefines" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="OptimizeCode" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="CheckUnderflowOverflow" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="AllowUnsafe" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="PreBuildEvent" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="PostBuildEvent" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="RunPostBuildEvent" minOccurs="0" default="OnBuildSuccess">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="OnBuildSuccess" />
|
||||
<xs:enumeration value="Always" />
|
||||
<xs:enumeration value="OnOutputUpdated" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="RunScript" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="PreBuildEventArgs" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="PostBuildEventArgs" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="WarningLevel" minOccurs="0">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:integer">
|
||||
<xs:minInclusive value="0" />
|
||||
<xs:maxInclusive value="4" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="WarningsAsErrors" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="SuppressWarnings" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="OutputPath" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="GenerateDocumentation" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="XmlDocFile" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="DebugInformation" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="RegisterComInterop" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="RemoveIntegerChecks" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="IncrementalBuild" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="BaseAddress" type="xs:string" minOccurs="0" />
|
||||
<xs:element name="FileAlignment" type="xs:integer" minOccurs="0" />
|
||||
<xs:element name="NoStdLib" type="xs:boolean" minOccurs="0" />
|
||||
<xs:element name="KeyFile" type="xs:string" minOccurs="0" />
|
||||
</xs:all>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Files">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="File" minOccurs="0" maxOccurs="unbounded" />
|
||||
<xs:element ref="Match" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="File">
|
||||
<xs:complexType>
|
||||
<xs:simpleContent>
|
||||
<xs:extension base="xs:string">
|
||||
<xs:attribute name="resourceName" type="xs:string" default="" />
|
||||
<xs:attribute name="buildAction" default="Compile">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="None" />
|
||||
<xs:enumeration value="Compile" />
|
||||
<xs:enumeration value="Content" />
|
||||
<xs:enumeration value="EmbeddedResource" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="subType" default="Code">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Code" />
|
||||
<xs:enumeration value="Component" />
|
||||
<xs:enumeration value="Form" />
|
||||
<xs:enumeration value="Settings" />
|
||||
<xs:enumeration value="UserControl" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="link" type="xs:boolean" />
|
||||
<xs:attribute name="copyToOutput" default="Never">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Never" />
|
||||
<xs:enumeration value="Always" />
|
||||
<xs:enumeration value="PreserveNewest" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
</xs:extension>
|
||||
</xs:simpleContent>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Match">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element ref="Exclude" minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:sequence>
|
||||
<xs:attribute name="path" type="xs:string" />
|
||||
<xs:attribute name="pattern" type="xs:string" use="required" />
|
||||
<xs:attribute name="recurse" type="xs:boolean" default="false" />
|
||||
<xs:attribute name="useRegex" type="xs:boolean" default="false" />
|
||||
<xs:attribute name="buildAction" default="Compile">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="None" />
|
||||
<xs:enumeration value="Compile" />
|
||||
<xs:enumeration value="Content" />
|
||||
<xs:enumeration value="EmbeddedResource" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="resourceName" type="xs:string" default="" />
|
||||
<xs:attribute name="subType" default="Code">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Code" />
|
||||
<xs:enumeration value="Component" />
|
||||
<xs:enumeration value="Designer" />
|
||||
<xs:enumeration value="Form" />
|
||||
<xs:enumeration value="Settings" />
|
||||
<xs:enumeration value="UserControl" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="link" type="xs:boolean" />
|
||||
<xs:attribute name="copyToOutput" default="Never">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="Never" />
|
||||
<xs:enumeration value="Always" />
|
||||
<xs:enumeration value="PreserveNewest" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:attribute>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="Exclude">
|
||||
<xs:complexType>
|
||||
<xs:attribute name="name" type="xs:string" use="required" />
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
Welcome to OpenSim!
|
||||
|
||||
Version 0.5
|
||||
|
||||
== OVERVIEW ==
|
||||
|
||||
OpenSim is a BSD Licensed Open Source project to develop a functioning
|
||||
virtual worlds server platform capable of supporting multiple clients
|
||||
and servers in a heterogeneous grid structure. OpenSim is written in
|
||||
C#, and can run under Mono or the Microsoft .NET runtimes.
|
||||
|
||||
This is considered an alpha release. Some stuff works, a lot
|
||||
doesn't. If it breaks, you get to keep *both* pieces.
|
||||
|
||||
== Installation on Windows ==
|
||||
|
||||
Prereqs:
|
||||
|
||||
* Load OpenSim.sln into Visual Studio .NET and build the solution.
|
||||
* chdir bin
|
||||
* OpenSim.exe
|
||||
|
||||
See configuring OpenSim
|
||||
|
||||
== Installation on Linux ==
|
||||
|
||||
Prereqs:
|
||||
* Mono >= 1.2.3.1
|
||||
* Nant >= 0.85
|
||||
* sqlite3
|
||||
|
||||
From the distribution type:
|
||||
* nant
|
||||
* cd bin
|
||||
* mono ./OpenSim.exe
|
||||
|
||||
See configuring OpenSim
|
||||
|
||||
== Configuring OpenSim ==
|
||||
|
||||
When OpenSim starts for the first time, you will be prompted with a
|
||||
series of questions that look something like:
|
||||
|
||||
[09-17 03:54:40] DEFAULT REGION CONFIG: Simulator Name [OpenSim Test]:
|
||||
|
||||
At each of these you must provide you own value or just hit enter to
|
||||
take the default (in this case "OpenSim Test").
|
||||
|
||||
YOUR SIM WILL NOT BE STARTED UNTIL YOU ANSWER ALL QUESTIONS
|
||||
|
||||
Once you are presented with a prompt that looks like:
|
||||
|
||||
Region# :
|
||||
|
||||
You have successfully started OpenSim.
|
||||
|
||||
== Connecting to your OpenSim ==
|
||||
|
||||
By default your sim will be running on http://127.0.0.1:9000. To use
|
||||
your OpenSim add -loginuri http://127.0.0.1:9000 to your second life
|
||||
client (running on the same machine as your OpenSim).
|
||||
|
||||
== More Information on OpenSim ==
|
||||
|
||||
More extensive information on building, running, and configuring
|
||||
OpenSim, as well as how to report bugs, and participate in the OpenSim
|
||||
project can always be found at http://opensimulator.org.
|
||||
|
||||
Thanks for trying OpenSim, we hope it was a pleasant experience.
|
|
@ -0,0 +1,24 @@
|
|||
==TESTING==
|
||||
To use nunit testing on opensim code, you have a variety of methods. The easiast methods involve using IDE capabilities to test code. Using VS2005/2008 I recommend using the testing capabilities of Resarper(commercial) or TestDriven.Net(free). Both will recognize nunit tests within your application and allow you to test them individually, or all at once, etc. You will also be able to step into debug mode into a test through these add-ins enabling a developer to jump right in and see how a specific test-case/scenerio works.
|
||||
|
||||
Additionally, it is my understanding that sharpdevelop and monodevelop have their own nunit testing plugins within their IDE. Though I am not certain of their exact feature set or stability.
|
||||
|
||||
== Using NUnit Directly ==
|
||||
The NUnit project is a very mature testing application. It can be obtained from www.nunit.org are via various package distrobutions for Linux. Please be sure to get a .Net 2.0 version of Nunit, as OpenSim makes use of .Net 2.0 functionality.
|
||||
|
||||
Nunit comes with 2 tools that will enable you to run tests from assembly inputs. Nunit-gui and nunit-console. NUnit-gui is a console that will let you view the execution of various tests within your assemblies and give visual indication of teir success or failure. This is a useful tool for those who lack IDE addins ( or lack IDEs at all ).
|
||||
|
||||
Nunit console allows you to execute the nunit tests of assemblies via console. Its output will show test failures and successes and a summary of what happened. This is very useful for a quick overview and/or automated testing.
|
||||
|
||||
Windows
|
||||
Windows version of nunit-console is by default .Net 2.0 if you downloaded the .Net 2.0 version of Nunit. Be sure to setup your PATH environment variable.
|
||||
|
||||
Linux & OSX
|
||||
On these operating systems you will have to use the command "nunit-console2"
|
||||
|
||||
Example
|
||||
|
||||
nunit-console2 OpenSim.Framework.Tests.dll (on linux)
|
||||
nunit-console OpenSim.Framework.Tests.dll (on windows)
|
||||
|
||||
For more information on testing contact the autor of this testing readme: Daedius Moskvitch ( daedius @@@@ daedius com)
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* Copyright (c) Tribal Media AB, http://tribalmedia.se/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * The name of Tribal Media AB may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
|
||||
namespace TribalMedia.Framework.Data
|
||||
{
|
||||
public class BaseDataReader
|
||||
{
|
||||
private readonly IDataReader m_source;
|
||||
|
||||
public BaseDataReader(IDataReader source)
|
||||
{
|
||||
m_source = source;
|
||||
}
|
||||
|
||||
public object Get(string name)
|
||||
{
|
||||
return m_source[name];
|
||||
}
|
||||
|
||||
public ushort GetUShort(string name)
|
||||
{
|
||||
return (ushort)m_source.GetInt32(m_source.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public byte GetByte(string name)
|
||||
{
|
||||
int ordinal = m_source.GetOrdinal(name);
|
||||
byte value = (byte)m_source.GetInt16(ordinal);
|
||||
return value;
|
||||
}
|
||||
|
||||
public sbyte GetSByte(string name)
|
||||
{
|
||||
return (sbyte)m_source.GetInt16(m_source.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public float GetFloat(string name)
|
||||
{
|
||||
return m_source.GetFloat(m_source.GetOrdinal(name));
|
||||
}
|
||||
|
||||
public byte[] GetBytes(string name)
|
||||
{
|
||||
int ordinal = m_source.GetOrdinal(name);
|
||||
|
||||
if (m_source.GetValue(ordinal) == DBNull.Value)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[16384];
|
||||
|
||||
MemoryStream memStream = new MemoryStream();
|
||||
|
||||
long totalRead = 0;
|
||||
|
||||
int bytesRead;
|
||||
do
|
||||
{
|
||||
bytesRead = (int)m_source.GetBytes(ordinal, totalRead, buffer, 0, buffer.Length);
|
||||
totalRead += bytesRead;
|
||||
|
||||
memStream.Write(buffer, 0, bytesRead);
|
||||
} while (bytesRead == buffer.Length);
|
||||
|
||||
return memStream.ToArray();
|
||||
}
|
||||
|
||||
public string GetString(string name)
|
||||
{
|
||||
int ordinal = m_source.GetOrdinal(name);
|
||||
object value = m_source.GetValue(ordinal);
|
||||
|
||||
if (value is DBNull)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return (string)value;
|
||||
}
|
||||
|
||||
public bool Read()
|
||||
{
|
||||
return m_source.Read();
|
||||
}
|
||||
|
||||
public Guid GetGuid(string name)
|
||||
{
|
||||
string guidString = GetString(name);
|
||||
if (String.IsNullOrEmpty(guidString))
|
||||
{
|
||||
return Guid.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
return new Guid(guidString);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,142 @@
|
|||
/*
|
||||
* Copyright (c) Tribal Media AB, http://tribalmedia.se/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * The name of Tribal Media AB may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace TribalMedia.Framework.Data
|
||||
{
|
||||
public abstract class BaseDatabaseConnector
|
||||
{
|
||||
protected string m_connectionString;
|
||||
|
||||
public BaseDatabaseConnector(string connectionString)
|
||||
{
|
||||
m_connectionString = connectionString;
|
||||
}
|
||||
|
||||
public abstract DbConnection GetNewConnection();
|
||||
public abstract string CreateParamName(string fieldName);
|
||||
|
||||
public DbCommand CreateSelectCommand(BaseTableMapper mapper, DbConnection connection, string fieldName, object key)
|
||||
{
|
||||
string table = mapper.TableName;
|
||||
|
||||
DbCommand command = connection.CreateCommand();
|
||||
|
||||
string conditionString = CreateCondition(mapper, command, fieldName, key);
|
||||
|
||||
string query =
|
||||
String.Format("select * from {0} where {1}", table, conditionString);
|
||||
|
||||
command.CommandText = query;
|
||||
command.CommandType = CommandType.Text;
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
public string CreateCondition(BaseTableMapper mapper, DbCommand command, string fieldName, object key)
|
||||
{
|
||||
string keyFieldParamName = mapper.CreateParamName(fieldName);
|
||||
|
||||
DbParameter param = command.CreateParameter();
|
||||
param.ParameterName = keyFieldParamName;
|
||||
param.Value = ConvertToDbType(key);
|
||||
command.Parameters.Add(param);
|
||||
|
||||
return String.Format("{0}={1}", fieldName, keyFieldParamName);
|
||||
}
|
||||
|
||||
public DbCommand CreateUpdateCommand(BaseTableMapper mapper, DbConnection connection, object rowMapper, object primaryKey)
|
||||
{
|
||||
string table = mapper.TableName;
|
||||
|
||||
List<string> fieldNames = new List<string>();
|
||||
|
||||
DbCommand command = connection.CreateCommand();
|
||||
|
||||
foreach (BaseFieldMapper fieldMapper in mapper.Schema.Fields.Values)
|
||||
{
|
||||
if (fieldMapper != mapper.KeyFieldMapper)
|
||||
{
|
||||
fieldMapper.ExpandField(rowMapper, command, fieldNames);
|
||||
}
|
||||
}
|
||||
|
||||
List<string> assignments = new List<string>();
|
||||
|
||||
foreach (string field in fieldNames)
|
||||
{
|
||||
assignments.Add(String.Format("{0}={1}", field, mapper.CreateParamName(field)));
|
||||
}
|
||||
|
||||
string conditionString = mapper.CreateCondition(command, mapper.KeyFieldMapper.FieldName, primaryKey);
|
||||
|
||||
command.CommandText =
|
||||
String.Format("update {0} set {1} where {2}", table, String.Join(", ", assignments.ToArray()),
|
||||
conditionString);
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
public DbCommand CreateInsertCommand(BaseTableMapper mapper, DbConnection connection, object obj)
|
||||
{
|
||||
string table = mapper.TableName;
|
||||
|
||||
List<string> fieldNames = new List<string>();
|
||||
|
||||
DbCommand command = connection.CreateCommand();
|
||||
|
||||
foreach (BaseFieldMapper fieldMapper in mapper.Schema.Fields.Values)
|
||||
{
|
||||
fieldMapper.ExpandField(obj, command, fieldNames);
|
||||
}
|
||||
|
||||
List<string> paramNames = new List<string>();
|
||||
|
||||
foreach (string field in fieldNames)
|
||||
{
|
||||
paramNames.Add(mapper.CreateParamName(field));
|
||||
}
|
||||
|
||||
command.CommandText =
|
||||
String.Format("insert into {0} ({1}) values ({2})", table, String.Join(", ", fieldNames.ToArray()),
|
||||
String.Join(", ", paramNames.ToArray()));
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
public virtual object ConvertToDbType(object value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
public abstract BaseDataReader CreateReader(IDataReader reader);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
* Copyright (c) Tribal Media AB, http://tribalmedia.se/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * The name of Tribal Media AB may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace TribalMedia.Framework.Data
|
||||
{
|
||||
public delegate TField ObjectGetAccessor<TObj, TField>(TObj obj);
|
||||
public delegate void ObjectSetAccessor<TObj, TField>(TObj obj, TField value);
|
||||
|
||||
public abstract class BaseFieldMapper
|
||||
{
|
||||
private readonly BaseTableMapper m_tableMapper;
|
||||
private readonly string m_fieldName;
|
||||
|
||||
public string FieldName
|
||||
{
|
||||
get { return m_fieldName; }
|
||||
}
|
||||
|
||||
protected Type m_valueType;
|
||||
|
||||
public Type ValueType
|
||||
{
|
||||
get { return m_valueType; }
|
||||
}
|
||||
|
||||
public abstract object GetParamValue(object obj);
|
||||
|
||||
public BaseFieldMapper(BaseTableMapper tableMapper, string fieldName, Type valueType)
|
||||
{
|
||||
m_fieldName = fieldName;
|
||||
m_valueType = valueType;
|
||||
m_tableMapper = tableMapper;
|
||||
}
|
||||
|
||||
public abstract void SetPropertyFromReader(object mapper, BaseDataReader reader);
|
||||
|
||||
public void RawAddParam(DbCommand command, List<string> fieldNames, string fieldName, object value)
|
||||
{
|
||||
string paramName = m_tableMapper.CreateParamName(fieldName);
|
||||
fieldNames.Add(fieldName);
|
||||
|
||||
DbParameter param = command.CreateParameter();
|
||||
param.ParameterName = paramName;
|
||||
param.Value = value;
|
||||
|
||||
command.Parameters.Add(param);
|
||||
}
|
||||
|
||||
public virtual void ExpandField<TObj>(TObj obj, DbCommand command, List<string> fieldNames)
|
||||
{
|
||||
string fieldName = FieldName;
|
||||
object value = GetParamValue(obj);
|
||||
|
||||
RawAddParam(command, fieldNames, fieldName, m_tableMapper.ConvertToDbType(value));
|
||||
}
|
||||
|
||||
protected virtual object GetValue(BaseDataReader reader)
|
||||
{
|
||||
object value;
|
||||
|
||||
if (ValueType == typeof(Guid))
|
||||
{
|
||||
value = reader.GetGuid(m_fieldName);
|
||||
}
|
||||
else if (ValueType == typeof(bool))
|
||||
{
|
||||
uint boolVal = reader.GetUShort(m_fieldName);
|
||||
value = (boolVal == 1);
|
||||
}
|
||||
else
|
||||
if (ValueType == typeof(byte))
|
||||
{
|
||||
value = reader.GetByte(m_fieldName);
|
||||
}
|
||||
else if (ValueType == typeof(sbyte))
|
||||
{
|
||||
value = reader.GetSByte(m_fieldName);
|
||||
}
|
||||
else if (ValueType == typeof(ushort))
|
||||
{
|
||||
value = reader.GetUShort(m_fieldName);
|
||||
}
|
||||
else if (ValueType == typeof(byte[]))
|
||||
{
|
||||
value = reader.GetBytes(m_fieldName);
|
||||
}
|
||||
else
|
||||
{
|
||||
value = reader.Get(m_fieldName);
|
||||
}
|
||||
|
||||
if (value is DBNull)
|
||||
{
|
||||
value = default(ValueType);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
public class ObjectField<TObject, TField> : BaseFieldMapper
|
||||
{
|
||||
private readonly ObjectGetAccessor<TObject, TField> m_fieldGetAccessor;
|
||||
private readonly ObjectSetAccessor<TObject, TField> m_fieldSetAccessor;
|
||||
|
||||
public override object GetParamValue(object obj)
|
||||
{
|
||||
return m_fieldGetAccessor((TObject)obj);
|
||||
}
|
||||
|
||||
public override void SetPropertyFromReader(object obj, BaseDataReader reader)
|
||||
{
|
||||
object value;
|
||||
|
||||
value = GetValue(reader);
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
m_fieldSetAccessor((TObject)obj, default(TField));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fieldSetAccessor((TObject)obj, (TField)value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ObjectField(BaseTableMapper tableMapper, string fieldName, ObjectGetAccessor<TObject, TField> rowMapperGetAccessor,
|
||||
ObjectSetAccessor<TObject, TField> rowMapperSetAccessor)
|
||||
: base(tableMapper, fieldName, typeof(TField))
|
||||
{
|
||||
m_fieldGetAccessor = rowMapperGetAccessor;
|
||||
m_fieldSetAccessor = rowMapperSetAccessor;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright (c) Tribal Media AB, http://tribalmedia.se/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * The name of Tribal Media AB may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using TribalMedia.Framework.Data;
|
||||
|
||||
namespace TribalMedia.Framework.Data
|
||||
{
|
||||
public abstract class BaseRowMapper
|
||||
{
|
||||
public abstract void FillObject(BaseDataReader reader);
|
||||
}
|
||||
|
||||
public class BaseRowMapper<TObj> : BaseRowMapper
|
||||
{
|
||||
private readonly BaseSchema m_schema;
|
||||
private readonly TObj m_obj;
|
||||
|
||||
public TObj Object
|
||||
{
|
||||
get { return m_obj; }
|
||||
}
|
||||
|
||||
public BaseRowMapper(BaseSchema schema, TObj obj)
|
||||
{
|
||||
m_schema = schema;
|
||||
m_obj = obj;
|
||||
}
|
||||
|
||||
public override void FillObject(BaseDataReader reader)
|
||||
{
|
||||
foreach (BaseFieldMapper fieldMapper in m_schema.Fields.Values)
|
||||
{
|
||||
fieldMapper.SetPropertyFromReader(this, reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Copyright (c) Tribal Media AB, http://tribalmedia.se/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * The name of Tribal Media AB may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using TribalMedia.Framework.Data;
|
||||
|
||||
namespace TribalMedia.Framework.Data
|
||||
{
|
||||
public class BaseSchema
|
||||
{
|
||||
protected BaseTableMapper m_tableMapper;
|
||||
protected Dictionary<string, BaseFieldMapper> m_mappings;
|
||||
|
||||
public Dictionary<string, BaseFieldMapper> Fields
|
||||
{
|
||||
get { return m_mappings; }
|
||||
}
|
||||
|
||||
public BaseSchema(BaseTableMapper tableMapper)
|
||||
{
|
||||
m_mappings = new Dictionary<string, BaseFieldMapper>();
|
||||
m_tableMapper = tableMapper;
|
||||
}
|
||||
}
|
||||
|
||||
public class BaseSchema<TObj> : BaseSchema
|
||||
{
|
||||
public BaseSchema(BaseTableMapper tableMapper)
|
||||
: base(tableMapper)
|
||||
{
|
||||
}
|
||||
|
||||
public ObjectField<TObj, TField> AddMapping<TField>(string fieldName,
|
||||
ObjectGetAccessor<TObj, TField> rowMapperGetAccessor,
|
||||
ObjectSetAccessor<TObj, TField> rowMapperSetAccessor)
|
||||
{
|
||||
ObjectField<TObj, TField> rowMapperField =
|
||||
new ObjectField<TObj, TField>(m_tableMapper, fieldName, rowMapperGetAccessor, rowMapperSetAccessor);
|
||||
|
||||
m_mappings.Add(fieldName, rowMapperField);
|
||||
|
||||
return rowMapperField;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,280 @@
|
|||
/*
|
||||
* Copyright (c) Tribal Media AB, http://tribalmedia.se/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * The name of Tribal Media AB may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using TribalMedia.Framework.Data;
|
||||
|
||||
namespace TribalMedia.Framework.Data
|
||||
{
|
||||
public abstract class BaseTableMapper
|
||||
{
|
||||
private readonly BaseDatabaseConnector m_database;
|
||||
private readonly object m_syncRoot = new object();
|
||||
|
||||
protected void WithConnection(Action<DbConnection> action)
|
||||
{
|
||||
lock (m_syncRoot)
|
||||
{
|
||||
DbConnection m_connection = m_database.GetNewConnection();
|
||||
|
||||
if (m_connection.State != ConnectionState.Open)
|
||||
{
|
||||
m_connection.Open();
|
||||
}
|
||||
|
||||
action(m_connection);
|
||||
|
||||
if (m_connection.State == ConnectionState.Open)
|
||||
{
|
||||
m_connection.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private readonly string m_tableName;
|
||||
public string TableName
|
||||
{
|
||||
get { return m_tableName; }
|
||||
}
|
||||
|
||||
protected BaseSchema m_schema;
|
||||
public BaseSchema Schema
|
||||
{
|
||||
get { return m_schema; }
|
||||
}
|
||||
|
||||
protected BaseFieldMapper m_keyFieldMapper;
|
||||
public BaseFieldMapper KeyFieldMapper
|
||||
{
|
||||
get { return m_keyFieldMapper; }
|
||||
}
|
||||
|
||||
public BaseTableMapper(BaseDatabaseConnector database, string tableName)
|
||||
{
|
||||
m_database = database;
|
||||
m_tableName = tableName.ToLower(); // Stupid MySQL hack.
|
||||
}
|
||||
|
||||
public string CreateParamName(string fieldName)
|
||||
{
|
||||
return m_database.CreateParamName(fieldName);
|
||||
}
|
||||
|
||||
protected DbCommand CreateSelectCommand(DbConnection connection, string fieldName, object primaryKey)
|
||||
{
|
||||
return m_database.CreateSelectCommand(this, connection, fieldName, primaryKey);
|
||||
}
|
||||
|
||||
public string CreateCondition(DbCommand command, string fieldName, object key)
|
||||
{
|
||||
return m_database.CreateCondition(this, command, fieldName, key);
|
||||
}
|
||||
|
||||
public DbCommand CreateInsertCommand(DbConnection connection, object obj)
|
||||
{
|
||||
return m_database.CreateInsertCommand(this, connection, obj);
|
||||
}
|
||||
|
||||
public DbCommand CreateUpdateCommand(DbConnection connection, object rowMapper, object primaryKey)
|
||||
{
|
||||
return m_database.CreateUpdateCommand(this, connection, rowMapper, primaryKey);
|
||||
}
|
||||
|
||||
public object ConvertToDbType(object value)
|
||||
{
|
||||
return m_database.ConvertToDbType(value);
|
||||
}
|
||||
|
||||
protected virtual BaseDataReader CreateReader(IDataReader reader)
|
||||
{
|
||||
return m_database.CreateReader(reader);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class BaseTableMapper<TRowMapper, TPrimaryKey> : BaseTableMapper
|
||||
{
|
||||
public BaseTableMapper(BaseDatabaseConnector database, string tableName)
|
||||
: base(database, tableName)
|
||||
{
|
||||
}
|
||||
|
||||
// HACK: This is a temporary function used by TryGetValue().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
private void TryGetConnectionValue(DbConnection connection, TPrimaryKey primaryKey, ref TRowMapper result, ref bool success)
|
||||
{
|
||||
using (
|
||||
DbCommand command =
|
||||
CreateSelectCommand(connection, KeyFieldMapper.FieldName, primaryKey))
|
||||
{
|
||||
using (IDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
result = FromReader( CreateReader(reader));
|
||||
success = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool TryGetValue(TPrimaryKey primaryKey, out TRowMapper value)
|
||||
{
|
||||
TRowMapper result = default(TRowMapper);
|
||||
bool success = false;
|
||||
|
||||
WithConnection(delegate(DbConnection connection)
|
||||
{
|
||||
TryGetConnectionValue(connection, primaryKey, ref result, ref success);
|
||||
});
|
||||
|
||||
value = result;
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
// HACK: This is a temporary function used by Remove().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
protected virtual void TryDelete(DbConnection connection, TPrimaryKey id, ref int deleted)
|
||||
{
|
||||
using (
|
||||
DbCommand command =
|
||||
CreateDeleteCommand(connection, KeyFieldMapper.FieldName, id))
|
||||
{
|
||||
deleted = command.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Remove(TPrimaryKey id)
|
||||
{
|
||||
int deleted = 0;
|
||||
|
||||
WithConnection(delegate(DbConnection connection)
|
||||
{
|
||||
TryDelete(connection, id, ref deleted);
|
||||
});
|
||||
|
||||
if (deleted == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public DbCommand CreateDeleteCommand(DbConnection connection, string fieldName, TPrimaryKey primaryKey)
|
||||
{
|
||||
string table = TableName;
|
||||
|
||||
DbCommand command = connection.CreateCommand();
|
||||
|
||||
string conditionString = CreateCondition(command, fieldName, primaryKey);
|
||||
|
||||
string query =
|
||||
String.Format("delete from {0} where {1}", table, conditionString);
|
||||
|
||||
command.CommandText = query;
|
||||
command.CommandType = CommandType.Text;
|
||||
|
||||
return command;
|
||||
}
|
||||
|
||||
// HACK: This is a temporary function used by Update().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
protected void TryUpdate(DbConnection connection, TPrimaryKey primaryKey, TRowMapper value, ref int updated)
|
||||
{
|
||||
using (DbCommand command = CreateUpdateCommand(connection, value, primaryKey))
|
||||
{
|
||||
updated = command.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Update(TPrimaryKey primaryKey, TRowMapper value)
|
||||
{
|
||||
int updated = 0;
|
||||
|
||||
WithConnection(delegate(DbConnection connection)
|
||||
{
|
||||
TryUpdate(connection, primaryKey, value, ref updated);
|
||||
});
|
||||
|
||||
if (updated == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// HACK: This is a temporary function used by Add().
|
||||
// Due to a bug in mono 1.2.6, delegate blocks cannot contain
|
||||
// a using() block. This has been fixed in SVN, so the next
|
||||
// mono release should work.
|
||||
protected void TryAdd(DbConnection connection, TRowMapper value, ref int added)
|
||||
{
|
||||
using (DbCommand command = CreateInsertCommand(connection, value))
|
||||
{
|
||||
added = command.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Add(TRowMapper value)
|
||||
{
|
||||
int added = 0;
|
||||
|
||||
WithConnection(delegate(DbConnection connection)
|
||||
{
|
||||
TryAdd(connection, value, ref added);
|
||||
});
|
||||
|
||||
if (added == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract TRowMapper FromReader(BaseDataReader reader);
|
||||
}
|
||||
}
|
66
ThirdParty/TribalMedia/TribalMedia.Framework.Data/Properties/AssemblyInfo.cs
vendored
Normal file
66
ThirdParty/TribalMedia/TribalMedia.Framework.Data/Properties/AssemblyInfo.cs
vendored
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
* Copyright (c) Tribal Media AB, http://tribalmedia.se/
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * The name of Tribal Media AB may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
|
||||
[assembly : AssemblyTitle("TribalMedia.Framework.Data")]
|
||||
[assembly : AssemblyDescription("Generic Database Abstraction Layer")]
|
||||
[assembly : AssemblyConfiguration("")]
|
||||
[assembly : AssemblyCompany("TribalMedia")]
|
||||
[assembly : AssemblyProduct("TribalMedia.Framework.Data")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2007 Tribal Media")]
|
||||
[assembly : AssemblyTrademark("")]
|
||||
[assembly : AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
|
||||
[assembly : ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
|
||||
[assembly : Guid("9269f421-19d9-4eea-bfe3-c0ffe426fada")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("1.0.0.0")]
|
||||
[assembly : AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly : AllowPartiallyTrustedCallers]
|
BIN
ThirdParty/TribalMedia/TribalMedia.Framework.Data/TribalMedia.Framework.Data.snk
vendored
Normal file
BIN
ThirdParty/TribalMedia/TribalMedia.Framework.Data/TribalMedia.Framework.Data.snk
vendored
Normal file
Binary file not shown.
3109
prebuild.xml
3109
prebuild.xml
File diff suppressed because it is too large
Load Diff
|
@ -1,2 +1,2 @@
|
|||
bin\Prebuild.exe /target nant
|
||||
bin\Prebuild.exe /target nant
|
||||
bin\Prebuild.exe /target vs2008
|
|
@ -0,0 +1,160 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os, os.path, popen2, re, string, sys
|
||||
|
||||
def textfile(file):
|
||||
return {
|
||||
"svn:eol-style" : "native"
|
||||
}
|
||||
|
||||
def script(file):
|
||||
return {
|
||||
"svn:eol-style" : "native",
|
||||
"svn:executable" : "*"
|
||||
}
|
||||
|
||||
def executable(file):
|
||||
return {
|
||||
"svn:executable" : "*",
|
||||
"svn:mime-type" : "application/octet-stream"
|
||||
}
|
||||
|
||||
def binary(file):
|
||||
return {
|
||||
"svn:mime-type" : "application/octet-stream"
|
||||
}
|
||||
|
||||
def is_binary(file):
|
||||
f = open(file)
|
||||
data = f.read()
|
||||
f.close()
|
||||
|
||||
for c in data:
|
||||
if c not in string.printable:
|
||||
return True
|
||||
return False
|
||||
|
||||
def binary_or_text(file):
|
||||
if is_binary(file):
|
||||
return binary(file)
|
||||
else:
|
||||
return textfile(file)
|
||||
|
||||
property_map = {
|
||||
".bat" : script,
|
||||
".config" : textfile,
|
||||
".cs" : textfile,
|
||||
".csproj" : textfile,
|
||||
".dat" : binary_or_text,
|
||||
".dll" : binary,
|
||||
".dylib" : binary,
|
||||
".example" : textfile,
|
||||
".exe" : executable,
|
||||
".fxcop" : textfile,
|
||||
".ico" : binary,
|
||||
".include" : textfile,
|
||||
".ini" : textfile,
|
||||
".j2c" : binary,
|
||||
".jp2" : binary,
|
||||
".lsl" : textfile,
|
||||
".mdp" : textfile,
|
||||
".mds" : textfile,
|
||||
".nsi" : textfile,
|
||||
".pdb" : binary,
|
||||
".php" : script,
|
||||
".pidb" : binary,
|
||||
".pl" : script,
|
||||
".png" : binary,
|
||||
".py" : script,
|
||||
".rb" : script,
|
||||
".resx" : textfile,
|
||||
".settings" : textfile,
|
||||
".stetic" : textfile,
|
||||
".sh" : script,
|
||||
".snk" : binary,
|
||||
".so" : binary,
|
||||
".sql" : textfile,
|
||||
".txt" : textfile,
|
||||
".userprefs" : textfile,
|
||||
".usertasks" : textfile,
|
||||
".xml" : textfile,
|
||||
".xsd" : textfile
|
||||
}
|
||||
|
||||
def propset(file, property, value):
|
||||
os.system('svn propset %s "%s" "%s"' % (property, value, file))
|
||||
|
||||
def propdel(file, property):
|
||||
os.system('svn propdel %s "%s"' % (property, file))
|
||||
|
||||
def propget(file, property):
|
||||
output, input, error = popen2.popen3('svn propget %s "%s"' % (property, file))
|
||||
|
||||
err = error.read()
|
||||
if err != "":
|
||||
output.close()
|
||||
error.close()
|
||||
input.close()
|
||||
return ""
|
||||
|
||||
result = output.read()
|
||||
output.close()
|
||||
error.close()
|
||||
input.close()
|
||||
return result.strip()
|
||||
|
||||
def proplist(file):
|
||||
output, input, error = popen2.popen3('svn proplist "%s"' % file)
|
||||
|
||||
err = error.read()
|
||||
if err != "":
|
||||
output.close()
|
||||
error.close()
|
||||
input.close()
|
||||
return None
|
||||
|
||||
result = output.readlines()
|
||||
output.close()
|
||||
error.close()
|
||||
input.close()
|
||||
if len(result) > 0 and re.match("^Properties on .*:$", result[0]) is not None:
|
||||
return [r.strip() for r in result[1:]]
|
||||
else:
|
||||
return ""
|
||||
|
||||
def update_file(file, properties):
|
||||
current_props = proplist(file)
|
||||
|
||||
if current_props is None:
|
||||
# svn error occurred -- probably an unversioned file
|
||||
return
|
||||
|
||||
for p in current_props:
|
||||
if not properties.has_key(p):
|
||||
propdel(file, p)
|
||||
|
||||
for p in properties:
|
||||
if p not in current_props or propget(file, p) != properties[p]:
|
||||
propset(file, p, properties[p])
|
||||
|
||||
def update(dir):
|
||||
for f in os.listdir(dir):
|
||||
fullpath = os.path.join(dir, f)
|
||||
if os.path.isdir(fullpath):
|
||||
if not os.path.islink(fullpath):
|
||||
update(fullpath)
|
||||
else:
|
||||
extension = os.path.splitext(fullpath)[1].lower()
|
||||
if property_map.has_key(extension):
|
||||
update_file(fullpath, property_map[extension](fullpath))
|
||||
elif extension != "" and proplist(fullpath) is not None:
|
||||
print "Warning: No properties defined for %s files (%s)" % (extension, fullpath)
|
||||
|
||||
def main(argv = None):
|
||||
if argv is None:
|
||||
argv = sys.argv
|
||||
|
||||
update(".")
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
Loading…
Reference in New Issue