You've already forked linux-packaging-mono
Imported Upstream version 4.2.0.179
Former-commit-id: 4610231f55806d2a05ed69e5ff3faa7336cc1479
This commit is contained in:
committed by
Jo Shields
parent
aa7da660d6
commit
c042cd0c52
@@ -25,6 +25,7 @@ namespace System.Xml.Serialization {
|
||||
}
|
||||
|
||||
static void EnsureSettingsLoaded() {
|
||||
#if CONFIGURATION_DEP
|
||||
if (!settingsInitalized) {
|
||||
lock (appSettingsLock) {
|
||||
if (!settingsInitalized) {
|
||||
@@ -48,6 +49,7 @@ namespace System.Xml.Serialization {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1727,6 +1727,7 @@ namespace System.Xml.Serialization {
|
||||
internal static string TempFilesLocation {
|
||||
get {
|
||||
if (tempFilesLocation == null) {
|
||||
#if CONFIGURATION_DEP
|
||||
// Return different XmlSerializerSection from legacy assembly due to its register config handlers
|
||||
object section = ConfigurationManager.GetSection(ConfigurationStrings.XmlSerializerSectionPath);
|
||||
string location = null;
|
||||
@@ -1736,6 +1737,9 @@ namespace System.Xml.Serialization {
|
||||
location = configSection.TempFilesLocation;
|
||||
}
|
||||
}
|
||||
#else
|
||||
string location = null;
|
||||
#endif
|
||||
if (location != null) {
|
||||
tempFilesLocation = location.Trim();
|
||||
}
|
||||
|
||||
@@ -102,8 +102,12 @@ namespace System.Xml.Serialization {
|
||||
return (bool) AppSettings.UseLegacySerializerGeneration;
|
||||
}
|
||||
else {
|
||||
#if CONFIGURATION_DEP
|
||||
XmlSerializerSection configSection = ConfigurationManager.GetSection(ConfigurationStrings.XmlSerializerSectionPath) as XmlSerializerSection;
|
||||
return configSection == null ? false : configSection.UseLegacySerializerGeneration;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -663,8 +667,10 @@ namespace System.Xml.Serialization {
|
||||
parameters.GenerateInMemory = true;
|
||||
|
||||
if (string.IsNullOrEmpty(location)) {
|
||||
#if CONFIGURATION_DEP
|
||||
XmlSerializerSection configSection = ConfigurationManager.GetSection(ConfigurationStrings.XmlSerializerSectionPath) as XmlSerializerSection;
|
||||
location = configSection == null ? location : configSection.TempFilesLocation;
|
||||
#endif
|
||||
// Trim leading and trailing white spaces (VSWhidbey 229873)
|
||||
if (!string.IsNullOrEmpty(location)) {
|
||||
location = location.Trim();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// </copyright>
|
||||
// <owner current="true" primary="true">[....]</owner>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if CONFIGURATION_DEP
|
||||
namespace System.Xml.Serialization.Configuration
|
||||
{
|
||||
using System;
|
||||
@@ -53,4 +53,4 @@ namespace System.Xml.Serialization.Configuration
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// </copyright>
|
||||
// <owner current="true" primary="true">[....]</owner>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if CONFIGURATION_DEP
|
||||
namespace System.Xml.Serialization.Configuration
|
||||
{
|
||||
using System;
|
||||
@@ -126,4 +126,4 @@ namespace System.Xml.Serialization.Configuration
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// </copyright>
|
||||
// <owner current="true" primary="true">[....]</owner>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if CONFIGURATION_DEP
|
||||
namespace System.Xml.Serialization.Configuration
|
||||
{
|
||||
|
||||
@@ -95,4 +95,4 @@ namespace System.Xml.Serialization.Configuration
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// </copyright>
|
||||
// <owner current="true" primary="true">[....]</owner>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if CONFIGURATION_DEP
|
||||
namespace System.Xml.Serialization.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
@@ -105,3 +105,4 @@ namespace System.Xml.Serialization.Configuration
|
||||
ConfigurationPropertyOptions.IsDefaultCollection);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4,7 +4,7 @@
|
||||
// </copyright>
|
||||
// <owner current="true" primary="true">[....]</owner>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if CONFIGURATION_DEP
|
||||
namespace System.Xml.Serialization.Configuration
|
||||
{
|
||||
using System.Configuration;
|
||||
@@ -35,3 +35,4 @@ namespace System.Xml.Serialization.Configuration
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -1,3 +1,4 @@
|
||||
#if CONFIGURATION_DEP
|
||||
namespace System.Xml.Serialization.Configuration
|
||||
{
|
||||
using System;
|
||||
@@ -96,4 +97,4 @@ namespace System.Xml.Serialization.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -56,10 +56,12 @@ namespace System.Xml.Serialization {
|
||||
this.context = context;
|
||||
Schemas.SetCache(Context.Cache, Context.ShareTypes);
|
||||
|
||||
#if CONFIGURATION_DEP
|
||||
SchemaImporterExtensionsSection section = PrivilegedConfigurationManager.GetSection(ConfigurationStrings.SchemaImporterExtensionsSectionPath) as SchemaImporterExtensionsSection;
|
||||
if (section != null)
|
||||
extensions = section.SchemaImporterExtensionsInternal;
|
||||
else
|
||||
#endif
|
||||
extensions = new SchemaImporterExtensionCollection();
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
9bbd7e244026b20f0541c5c6e7484192f8669925
|
||||
b6800a7f4e641f45d10832207ee0dc87098e21de
|
||||
@@ -21,6 +21,7 @@ namespace System.Xml.Serialization {
|
||||
/// The <see cref="XmlCustomFormatter"/> class provides a set of static methods for converting
|
||||
/// primitive type values to and from their XML string representations.</summary>
|
||||
internal class XmlCustomFormatter {
|
||||
#if CONFIGURATION_DEP
|
||||
private static DateTimeSerializationSection.DateTimeSerializationMode mode;
|
||||
|
||||
static DateTimeSerializationSection.DateTimeSerializationMode Mode {
|
||||
@@ -38,6 +39,7 @@ namespace System.Xml.Serialization {
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
private XmlCustomFormatter() {}
|
||||
internal static string FromDefaultValue(object value, string formatter) {
|
||||
if (value == null) return null;
|
||||
@@ -79,13 +81,13 @@ namespace System.Xml.Serialization {
|
||||
}
|
||||
|
||||
internal static string FromDateTime(DateTime value) {
|
||||
#if CONFIGURATION_DEP
|
||||
if (Mode == DateTimeSerializationSection.DateTimeSerializationMode.Local) {
|
||||
return XmlConvert.ToString(value, "yyyy-MM-ddTHH:mm:ss.fffffffzzzzzz");
|
||||
}
|
||||
else {
|
||||
#endif
|
||||
// for mode DateTimeSerializationMode.Roundtrip and DateTimeSerializationMode.Default
|
||||
return XmlConvert.ToString(value, XmlDateTimeSerializationMode.RoundtripKind);
|
||||
}
|
||||
}
|
||||
|
||||
internal static string FromChar(char value) {
|
||||
@@ -314,10 +316,13 @@ namespace System.Xml.Serialization {
|
||||
};
|
||||
|
||||
internal static DateTime ToDateTime(string value) {
|
||||
#if CONFIGURATION_DEP
|
||||
if (Mode == DateTimeSerializationSection.DateTimeSerializationMode.Local) {
|
||||
return ToDateTime(value, allDateTimeFormats);
|
||||
}
|
||||
else {
|
||||
else
|
||||
#endif
|
||||
{
|
||||
// for mode DateTimeSerializationMode.Roundtrip and DateTimeSerializationMode.Default
|
||||
return XmlConvert.ToDateTime(value, XmlDateTimeSerializationMode.RoundtripKind);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user