fall back to a obsolete property since several monos in use (include our own) do not suporte the proper .net4.0 one

0.9.0.1-postfixes
UbitUmarov 2018-01-08 12:00:21 +00:00
parent 89a690c11f
commit eec3921800
21 changed files with 26 additions and 22 deletions

View File

@ -83,7 +83,7 @@ namespace OpenSim.Framework.Capabilities
{
using (XmlTextReader reader = new XmlTextReader(st))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
reader.Read();

View File

@ -193,7 +193,7 @@ namespace OpenSim.Framework
using(MemoryStream ms = new MemoryStream(enc.GetBytes(text)))
using(XmlTextReader xreader = new XmlTextReader(ms))
{
xreader.DtdProcessing = DtdProcessing.Prohibit;
xreader.ProhibitDtd = true;
xreader.XmlResolver = null;
v = new PhysicsInertiaData();

View File

@ -1595,7 +1595,7 @@ namespace OpenSim.Framework
{
using (XmlTextReader xtr = new XmlTextReader(sr))
{
xtr.DtdProcessing = DtdProcessing.Prohibit;
xtr.ProhibitDtd = true;
xtr.XmlResolver = null;
xtr.MoveToContent();

View File

@ -221,7 +221,7 @@ namespace OpenSim.Framework.Serialization.External
using (StringWriter sw = new StringWriter())
using (XmlTextWriter writer = new XmlTextWriter(sw))
using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true, XmlResolver = null }))
{
TransformXml(reader, writer, sceneName, homeURL, userService, scopeID);

View File

@ -178,7 +178,7 @@ namespace OpenSim.Framework.Serialization.External
using (XmlTextReader reader = new XmlTextReader(new StringReader(serializedLandData)))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
reader.ReadStartElement("LandData");

View File

@ -63,7 +63,7 @@ namespace OpenSim.Framework.Serialization.External
StringReader sr = new StringReader(serializedSettings);
XmlTextReader xtr = new XmlTextReader(sr);
xtr.DtdProcessing = DtdProcessing.Prohibit;
xtr.ProhibitDtd = true;
xtr.XmlResolver = null;
xtr.ReadStartElement("RegionSettings");

View File

@ -202,7 +202,7 @@ namespace OpenSim.Framework.Serialization.External
using (XmlTextReader reader = new XmlTextReader(new StringReader(serialization)))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
reader.ReadStartElement("InventoryItem");

View File

@ -54,7 +54,7 @@ namespace OpenSim.Framework.Servers.HttpServer
TRequest deserial;
using (XmlTextReader xmlReader = new XmlTextReader(request))
{
xmlReader.DtdProcessing = DtdProcessing.Prohibit;
xmlReader.ProhibitDtd = true;
xmlReader.XmlResolver = null;
XmlSerializer deserializer = new XmlSerializer(typeof (TRequest));

View File

@ -210,7 +210,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
xmlReader.DtdProcessing = DtdProcessing.Prohibit;
xmlReader.ProhibitDtd = true;
xmlReader.XmlResolver = null;
XmlSerializer deserializer = new XmlSerializer(typeof(RestSessionObject<TRequest>));
deserial = (RestSessionObject<TRequest>)deserializer.Deserialize(xmlReader);
@ -271,7 +271,7 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
xmlReader.DtdProcessing = DtdProcessing.Prohibit;
xmlReader.ProhibitDtd = true;
xmlReader.XmlResolver = null;
XmlSerializer deserializer = new XmlSerializer(typeof(TRequest));
deserial = (TRequest)deserializer.Deserialize(xmlReader);

View File

@ -124,7 +124,7 @@ namespace OpenSim.Region.CoreModules.Avatar.BakedTextures
{
using(XmlTextReader sr = new XmlTextReader(s))
{
sr.DtdProcessing = DtdProcessing.Prohibit;
sr.ProhibitDtd = true;
sr.XmlResolver = null;
sr.ReadStartElement("BakedAppearance");
while(sr.LocalName == "BakedTexture")

View File

@ -1130,7 +1130,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
XmlParserContext context = new XmlParserContext(null, nsmgr, null, XmlSpace.None);
XmlTextReader xtr = new XmlTextReader(Encoding.ASCII.GetString(data), XmlNodeType.Document, context);
xtr.DtdProcessing = DtdProcessing.Prohibit;
xtr.ProhibitDtd = true;
xtr.XmlResolver = null;
// Loaded metadata will be empty if no information exists in the archive

View File

@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
StringReader sr = new StringReader(xml);
XmlTextReader reader = new XmlTextReader(sr);
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
reader.ReadStartElement("assets");

View File

@ -720,6 +720,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
string xml = SceneObjectSerializer.ToOriginalXmlFormat(so);
XmlTextReader xtr = new XmlTextReader(new StringReader(xml));
xtr.ProhibitDtd = true;
xtr.XmlResolver = null;
xtr.ReadStartElement("SceneObjectGroup");
xtr.ReadStartElement("RootPart");
xtr.ReadStartElement("SceneObjectPart");
@ -831,6 +833,8 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
string xml2 = m_serialiserModule.SerializeGroupToXml2(so, options);
XmlTextReader xtr = new XmlTextReader(new StringReader(xml2));
xtr.ProhibitDtd = true;
xtr.XmlResolver = null;
xtr.ReadStartElement("SceneObjectGroup");
xtr.ReadStartElement("SceneObjectPart");

View File

@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
using (XmlTextReader reader = new XmlTextReader(path))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
XmlDocument doc = new XmlDocument();
doc.XmlResolver = null;

View File

@ -593,7 +593,7 @@ namespace OpenSim.Region.Framework.Scenes
UTF8Encoding enc = new UTF8Encoding();
MemoryStream ms = new MemoryStream(enc.GetBytes(text));
XmlTextReader xreader = new XmlTextReader(ms);
xreader.DtdProcessing = DtdProcessing.Prohibit;
xreader.ProhibitDtd = true;
xreader.XmlResolver = null;
SOPVehicle v = new SOPVehicle();

View File

@ -2389,7 +2389,7 @@ namespace OpenSim.Region.Framework.Scenes
{
using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
{
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true, XmlResolver = null }))
{
reader.Read();
bool isSingleObject = reader.Name != "CoalescedObject";

View File

@ -133,7 +133,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
{
using (XmlTextReader reader = new XmlTextReader(sr))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
reader.MoveToContent(); // skip possible xml declaration

View File

@ -63,7 +63,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
String fixedData = ExternalRepresentationUtils.SanitizeXml(xmlData);
using (XmlTextReader wrappedReader = new XmlTextReader(fixedData, XmlNodeType.Element, null))
{
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, DtdProcessing = DtdProcessing.Prohibit, XmlResolver = null }))
using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment, ProhibitDtd = true, XmlResolver = null }))
{
try
{
@ -272,7 +272,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
{
using(XmlTextReader reader = new XmlTextReader(sr))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));

View File

@ -57,7 +57,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
using(XmlTextReader reader = new XmlTextReader(fileName))
{
reader.WhitespaceHandling = WhitespaceHandling.None;
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
doc.Load(reader);

View File

@ -200,7 +200,7 @@ namespace OpenSim.Region.Framework.Scenes
{
using(XmlTextReader reader = new XmlTextReader(sr))
{
reader.DtdProcessing = DtdProcessing.Prohibit;
reader.ProhibitDtd = true;
reader.XmlResolver = null;
ReadXml(reader);
}

View File

@ -1148,7 +1148,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
using (Stream s = rsp.GetResponseStream())
using (XmlTextReader rdr = new XmlTextReader(s))
{
rdr.DtdProcessing = DtdProcessing.Prohibit;
rdr.ProhibitDtd = true;
rdr.XmlResolver = null;
doc.Load(rdr);
}