Imported Upstream version 3.10.0

Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
Jo Shields
2014-10-04 11:27:48 +01:00
parent fe777c5c82
commit 8b9b85e7f5
970 changed files with 20242 additions and 31308 deletions

View File

@ -28,7 +28,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP && !TARGET_JVM
#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif

View File

@ -20,7 +20,7 @@
// Copyright (C) 2005, 2006 Novell, Inc (http://www.novell.com)
//
#if CONFIGURATION_DEP && !TARGET_JVM
#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif

View File

@ -32,7 +32,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if CONFIGURATION_DEP && !TARGET_JVM
#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
@ -47,32 +47,12 @@ using System.Security.Permissions;
using System.Xml;
using System.Xml.XPath;
#endif
#if TARGET_JVM
using vmw.common;
using vmw.@internal.io;
#endif
namespace System.Configuration
{
public sealed class ConfigurationSettings
{
#if !TARGET_JVM
static IConfigurationSystem config = DefaultConfig.GetInstance ();
#else
static IConfigurationSystem config {
get {
IConfigurationSystem conf = (IConfigurationSystem) AppDomain.CurrentDomain.GetData ("ConfigurationSettings.Config");
if (conf == null) {
conf = DefaultConfig.GetInstance ();
AppDomain.CurrentDomain.SetData ("ConfigurationSettings.Config", conf);
}
return conf;
}
set {
AppDomain.CurrentDomain.SetData ("ConfigurationSettings.Config", value);
}
}
#endif
static object lockobj = new object ();
private ConfigurationSettings ()
{
@ -123,23 +103,7 @@ namespace System.Configuration
//
class DefaultConfig : IConfigurationSystem
{
#if !TARGET_JVM
static readonly DefaultConfig instance = new DefaultConfig ();
#else
static DefaultConfig instance {
get {
DefaultConfig conf = (DefaultConfig) AppDomain.CurrentDomain.GetData ("DefaultConfig.instance");
if (conf == null) {
conf = new DefaultConfig ();
AppDomain.CurrentDomain.SetData ("DefaultConfig.instance", conf);
}
return conf;
}
set {
AppDomain.CurrentDomain.SetData ("DefaultConfig.instance", value);
}
}
#endif
ConfigurationData config;
private DefaultConfig ()
@ -185,16 +149,6 @@ namespace System.Configuration
config = data;
}
}
#if TARGET_JVM
internal static string GetBundledMachineConfig ()
{
return null;
}
internal static string GetMachineConfigPath ()
{
return System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile;
}
#else
[MethodImplAttribute(MethodImplOptions.InternalCall)]
extern private static string get_bundled_machine_config ();
internal static string GetBundledMachineConfig ()
@ -207,7 +161,6 @@ namespace System.Configuration
{
return get_machine_config_path ();
}
#endif
private static string GetAppConfigPath ()
{
AppDomainSetup currentInfo = AppDomain.CurrentDomain.SetupInformation;
@ -291,29 +244,14 @@ namespace System.Configuration
#if (XML_DEP)
this.fileName = fileName;
if (fileName == null
#if !TARGET_JVM
|| !File.Exists (fileName)
#endif
)
return false;
XmlTextReader reader = null;
try {
#if !TARGET_JVM
FileStream fs = new FileStream (fileName, FileMode.Open, FileAccess.Read);
#else
Stream fs = (Stream) vmw.common.IOUtils.getStream (fileName);
//patch for machine.config
if (fs == null && fileName.EndsWith ("machine.config")) {
fs = (Stream) IOUtils.getStreamForGHConfigs (fileName);
}
if (fs == null) {
return false;
}
#endif
reader = new XmlTextReader (fs);
if (InitRead (reader))
ReadConfigFile (reader);

View File

@ -29,9 +29,7 @@
#if CONFIGURATION_DEP
#if !TARGET_JVM
extern alias PrebuiltSystem;
#endif
using System;
using System.Collections;
@ -44,11 +42,7 @@ using System.Security.Cryptography;
using System.Text;
using System.Xml;
#if TARGET_JVM
using NameValueCollection = System.Collections.Specialized.NameValueCollection;
#else
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
namespace System.Configuration
{
@ -264,7 +258,6 @@ namespace System.Configuration
return attrs [0].Company;
}
#if !TARGET_JVM
MethodInfo entryPoint = assembly.EntryPoint;
Type entryType = entryPoint != null ? entryPoint.DeclaringType : null;
if (entryType != null && !String.IsNullOrEmpty (entryType.Namespace)) {
@ -272,9 +265,6 @@ namespace System.Configuration
return end < 0 ? entryType.Namespace : entryType.Namespace.Substring (0, end);
}
return "Program";
#else
return assembly.GetName ().Name;
#endif
}
private static string GetProductName ()
@ -283,20 +273,11 @@ namespace System.Configuration
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
#if !TARGET_JVM
byte [] pkt = assembly.GetName ().GetPublicKeyToken ();
return String.Format ("{0}_{1}_{2}",
AppDomain.CurrentDomain.FriendlyName,
pkt != null && pkt.Length > 0 ? "StrongName" : "Url",
GetEvidenceHash());
#else // AssemblyProductAttribute-based code
AssemblyProductAttribute [] attrs = (AssemblyProductAttribute[]) assembly.GetCustomAttributes (typeof (AssemblyProductAttribute), true);
if ((attrs != null) && attrs.Length > 0) {
return attrs [0].Product;
}
return assembly.GetName ().Name;
#endif
}
// Note: Changed from base64() to hex output to avoid unexpected chars like '\' or '/' with filesystem meaning.
@ -341,19 +322,15 @@ namespace System.Configuration
ProductVersion = GetProductVersion ().Split('.');
// C:\Documents and Settings\(user)\Application Data
#if !TARGET_JVM
if (userRoamingBasePath == "")
userRoamingPath = Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData);
else
#endif
userRoamingPath = userRoamingBasePath;
// C:\Documents and Settings\(user)\Local Settings\Application Data (on Windows)
#if !TARGET_JVM
if (userLocalBasePath == "")
userLocalPath = Environment.GetFolderPath (Environment.SpecialFolder.LocalApplicationData);
else
#endif
userLocalPath = userLocalBasePath;
if (isCompany) {
@ -366,13 +343,11 @@ namespace System.Configuration
Assembly assembly = Assembly.GetEntryAssembly ();
if (assembly == null)
assembly = Assembly.GetCallingAssembly ();
#if !TARGET_JVM
byte [] pkt = assembly.GetName ().GetPublicKeyToken ();
ProductName = String.Format ("{0}_{1}_{2}",
ProductName,
pkt != null ? "StrongName" : "Url",
GetEvidenceHash());
#endif
}
userRoamingPath = Path.Combine (userRoamingPath, ProductName);
userLocalPath = Path.Combine (userLocalPath, ProductName);

View File

@ -28,7 +28,7 @@
//
#if CONFIGURATION_DEP
#if CONFIGURATION_DEP && !TARGET_JVM
#if CONFIGURATION_DEP
extern alias PrebuiltSystem;
using NameValueCollection = PrebuiltSystem.System.Collections.Specialized.NameValueCollection;
#endif
@ -59,14 +59,7 @@ namespace System.Configuration
public override SettingsPropertyValueCollection GetPropertyValues (SettingsContext context,
SettingsPropertyCollection properties)
{
#if TARGET_JVM
SettingsPropertyValueCollection pv = new SettingsPropertyValueCollection ();
foreach (SettingsProperty prop in properties)
pv.Add (new SettingsPropertyValue (prop));
return pv;
#else
return impl.GetPropertyValues (context, properties);
#endif
}
#if CONFIGURATION_DEP