Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@ -56,9 +56,9 @@ namespace System.Configuration.Internal
return host.CreateDeprecatedConfigContext (configPath);
}
public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
public virtual string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
{
return host.DecryptSection (encryptedXml, protectionProvider, protectedSection);
return host.DecryptSection (encryptedXml, protectionProvider, protectedConfigSection);
}
public virtual void DeleteStream (string streamName)
@ -66,14 +66,14 @@ namespace System.Configuration.Internal
host.DeleteStream (streamName);
}
public virtual string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection)
public virtual string EncryptSection (string clearTextXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection)
{
return host.EncryptSection (encryptedXml, protectionProvider, protectedSection);
return host.EncryptSection (clearTextXml, protectionProvider, protectedConfigSection);
}
public virtual string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath)
public virtual string GetConfigPathFromLocationSubPath (string configPath, string locationSubPath)
{
return host.GetConfigPathFromLocationSubPath (configPath, locatinSubPath);
return host.GetConfigPathFromLocationSubPath (configPath, locationSubPath);
}
public virtual Type GetConfigType (string typeName, bool throwOnError)
@ -111,14 +111,14 @@ namespace System.Configuration.Internal
return host.Impersonate ();
}
public virtual void Init (IInternalConfigRoot root, params object[] hostInitParams)
public virtual void Init (IInternalConfigRoot configRoot, params object[] hostInitParams)
{
host.Init (root, hostInitParams);
host.Init (configRoot, hostInitParams);
}
public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams)
public virtual void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams)
{
host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, root, hostInitConfigurationParams);
host.InitForConfiguration (ref locationSubPath, out configPath, out locationConfigPath, configRoot, hostInitConfigurationParams);
}
public virtual bool IsAboveApplication (string configPath)

View File

@ -38,10 +38,10 @@ namespace System.Configuration.Internal
{
object CreateConfigurationContext (string configPath, string locationSubPath);
object CreateDeprecatedConfigContext (string configPath);
string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
string DecryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
void DeleteStream (string streamName);
string EncryptSection (string encryptedXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedSection);
string GetConfigPathFromLocationSubPath (string configPath, string locatinSubPath);
string EncryptSection (string clearTextXml, ProtectedConfigurationProvider protectionProvider, ProtectedConfigurationSection protectedConfigSection);
string GetConfigPathFromLocationSubPath (string configPath, string locationSubPath);
Type GetConfigType (string typeName, bool throwOnError);
string GetConfigTypeName (Type t);
void GetRestrictedPermissions (IInternalConfigRecord configRecord, out PermissionSet permissionSet, out bool isHostReady);
@ -49,8 +49,8 @@ namespace System.Configuration.Internal
string GetStreamNameForConfigSource (string streamName, string configSource);
object GetStreamVersion (string streamName);
IDisposable Impersonate ();
void Init (IInternalConfigRoot root, params object[] hostInitParams);
void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot root, params object[] hostInitConfigurationParams);
void Init (IInternalConfigRoot configRoot, params object[] hostInitParams);
void InitForConfiguration (ref string locationSubPath, out string configPath, out string locationConfigPath, IInternalConfigRoot configRoot, params object[] hostInitConfigurationParams);
bool IsAboveApplication (string configPath);
bool IsConfigRecordRequired (string configPath);
bool IsDefinitionAllowed (string configPath, ConfigurationAllowDefinition allowDefinition, ConfigurationAllowExeDefinition allowExeDefinition);

View File

@ -95,10 +95,10 @@ namespace System.Configuration {
[MonoTODO]
protected internal override string SerializeSection (
ConfigurationElement parent, string name, ConfigurationSaveMode mode)
ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode)
{
if (File == "") {
return base.SerializeSection (parent, name, mode);
return base.SerializeSection (parentElement, name, saveMode);
}
else {
throw new NotImplementedException ();

View File

@ -251,9 +251,9 @@ namespace System.Configuration {
get { return RootSectionGroup.Sections; }
}
public ConfigurationSection GetSection (string path)
public ConfigurationSection GetSection (string sectionName)
{
string[] parts = path.Split ('/');
string[] parts = sectionName.Split ('/');
if (parts.Length == 1)
return Sections [parts[0]];
@ -267,9 +267,9 @@ namespace System.Configuration {
return null;
}
public ConfigurationSectionGroup GetSectionGroup (string path)
public ConfigurationSectionGroup GetSectionGroup (string sectionGroupName)
{
string[] parts = path.Split ('/');
string[] parts = sectionGroupName.Split ('/');
ConfigurationSectionGroup group = SectionGroups [parts[0]];
for (int n=1; group != null && n<parts.Length; n++)
group = group.SectionGroups [parts [n]];
@ -388,14 +388,14 @@ namespace System.Configuration {
Save (ConfigurationSaveMode.Modified, false);
}
public void Save (ConfigurationSaveMode mode)
public void Save (ConfigurationSaveMode saveMode)
{
Save (mode, false);
Save (saveMode, false);
}
public void Save (ConfigurationSaveMode mode, bool forceUpdateAll)
public void Save (ConfigurationSaveMode saveMode, bool forceSaveAll)
{
if (!forceUpdateAll && (mode != ConfigurationSaveMode.Full) && !HasValues (mode)) {
if (!forceSaveAll && (saveMode != ConfigurationSaveMode.Full) && !HasValues (saveMode)) {
ResetModified ();
return;
}
@ -410,7 +410,7 @@ namespace System.Configuration {
if (saveStart != null)
saveStart (this, new ConfigurationSaveEventArgs (streamName, true, null, ctx));
Save (stream, mode, forceUpdateAll);
Save (stream, saveMode, forceSaveAll);
system.Host.WriteCompleted (streamName, true, ctx);
} catch (Exception ex) {
saveEx = ex;
@ -428,15 +428,15 @@ namespace System.Configuration {
SaveAs (filename, ConfigurationSaveMode.Modified, false);
}
public void SaveAs (string filename, ConfigurationSaveMode mode)
public void SaveAs (string filename, ConfigurationSaveMode saveMode)
{
SaveAs (filename, mode, false);
SaveAs (filename, saveMode, false);
}
[MonoInternalNote ("Detect if file has changed")]
public void SaveAs (string filename, ConfigurationSaveMode mode, bool forceUpdateAll)
public void SaveAs (string filename, ConfigurationSaveMode saveMode, bool forceSaveAll)
{
if (!forceUpdateAll && (mode != ConfigurationSaveMode.Full) && !HasValues (mode)) {
if (!forceSaveAll && (saveMode != ConfigurationSaveMode.Full) && !HasValues (saveMode)) {
ResetModified ();
return;
}
@ -444,7 +444,7 @@ namespace System.Configuration {
string dir = Path.GetDirectoryName (Path.GetFullPath (filename));
if (!Directory.Exists (dir))
Directory.CreateDirectory (dir);
Save (new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write), mode, forceUpdateAll);
Save (new FileStream (filename, FileMode.OpenOrCreate, FileAccess.Write), saveMode, forceSaveAll);
}
void Save (Stream stream, ConfigurationSaveMode mode, bool forceUpdateAll)

View File

@ -155,7 +155,7 @@ namespace System.Configuration
}
[MonoTODO]
protected virtual void ListErrors (IList list)
protected virtual void ListErrors (IList errorList)
{
throw new NotImplementedException ();
}
@ -215,24 +215,24 @@ namespace System.Configuration
return defaultCollection;
}
protected internal object this [ConfigurationProperty property] {
get { return this [property.Name]; }
set { this [property.Name] = value; }
protected internal object this [ConfigurationProperty prop] {
get { return this [prop.Name]; }
set { this [prop.Name] = value; }
}
protected internal object this [string property_name] {
protected internal object this [string propertyName] {
get {
PropertyInformation pi = ElementInformation.Properties [property_name];
PropertyInformation pi = ElementInformation.Properties [propertyName];
if (pi == null)
throw new InvalidOperationException ("Property '" + property_name + "' not found in configuration element");
throw new InvalidOperationException ("Property '" + propertyName + "' not found in configuration element");
return pi.Value;
}
set {
PropertyInformation pi = ElementInformation.Properties [property_name];
PropertyInformation pi = ElementInformation.Properties [propertyName];
if (pi == null)
throw new InvalidOperationException ("Property '" + property_name + "' not found in configuration element");
throw new InvalidOperationException ("Property '" + propertyName + "' not found in configuration element");
SetPropertyValue (pi.Property, value, false);
@ -415,7 +415,7 @@ namespace System.Configuration
return false;
}
protected virtual bool OnDeserializeUnrecognizedElement (string element, XmlReader reader)
protected virtual bool OnDeserializeUnrecognizedElement (string elementName, XmlReader reader)
{
return false;
}
@ -545,16 +545,16 @@ namespace System.Configuration
}
protected internal virtual void Unmerge (
ConfigurationElement source, ConfigurationElement parent,
ConfigurationSaveMode updateMode)
ConfigurationElement sourceElement, ConfigurationElement parentElement,
ConfigurationSaveMode saveMode)
{
if (parent != null && source.GetType() != parent.GetType())
if (parentElement != null && sourceElement.GetType() != parentElement.GetType())
throw new ConfigurationErrorsException ("Can't unmerge two elements of different type");
bool isMinimalOrModified = updateMode == ConfigurationSaveMode.Minimal ||
updateMode == ConfigurationSaveMode.Modified;
bool isMinimalOrModified = saveMode == ConfigurationSaveMode.Minimal ||
saveMode == ConfigurationSaveMode.Modified;
foreach (PropertyInformation prop in source.ElementInformation.Properties)
foreach (PropertyInformation prop in sourceElement.ElementInformation.Properties)
{
if (prop.ValueOrigin == PropertyValueOrigin.Default)
continue;
@ -562,7 +562,7 @@ namespace System.Configuration
PropertyInformation unmergedProp = ElementInformation.Properties [prop.Name];
object sourceValue = prop.Value;
if (parent == null || !parent.HasValue (prop.Name)) {
if (parentElement == null || !parentElement.HasValue (prop.Name)) {
unmergedProp.Value = sourceValue;
continue;
}
@ -570,26 +570,26 @@ namespace System.Configuration
if (sourceValue == null)
continue;
object parentValue = parent [prop.Name];
object parentValue = parentElement [prop.Name];
if (!prop.IsElement) {
if (!object.Equals (sourceValue, parentValue) ||
(updateMode == ConfigurationSaveMode.Full) ||
(updateMode == ConfigurationSaveMode.Modified && prop.ValueOrigin == PropertyValueOrigin.SetHere))
(saveMode == ConfigurationSaveMode.Full) ||
(saveMode == ConfigurationSaveMode.Modified && prop.ValueOrigin == PropertyValueOrigin.SetHere))
unmergedProp.Value = sourceValue;
continue;
}
var sourceElement = (ConfigurationElement) sourceValue;
if (isMinimalOrModified && !sourceElement.IsModified ())
var sourceElementValue = (ConfigurationElement) sourceValue;
if (isMinimalOrModified && !sourceElementValue.IsModified ())
continue;
if (parentValue == null) {
unmergedProp.Value = sourceValue;
continue;
}
var parentElement = (ConfigurationElement) parentValue;
var parentElementValue = (ConfigurationElement) parentValue;
ConfigurationElement copy = (ConfigurationElement) unmergedProp.Value;
copy.Unmerge (sourceElement, parentElement, updateMode);
copy.Unmerge (sourceElementValue, parentElementValue, saveMode);
}
}

View File

@ -555,7 +555,7 @@ namespace System.Configuration
return false;
}
protected internal override void Unmerge (ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode updateMode)
protected internal override void Unmerge (ConfigurationElement sourceElement, ConfigurationElement parentElement, ConfigurationSaveMode saveMode)
{
ConfigurationElementCollection source = (ConfigurationElementCollection) sourceElement;
ConfigurationElementCollection parent = (ConfigurationElementCollection) parentElement;
@ -565,9 +565,9 @@ namespace System.Configuration
object key = source.GetElementKey (sitem);
ConfigurationElement pitem = parent != null ? parent.BaseGet (key) as ConfigurationElement : null;
ConfigurationElement nitem = CreateNewElementInternal (null);
if (pitem != null && updateMode != ConfigurationSaveMode.Full) {
nitem.Unmerge (sitem, pitem, updateMode);
if (nitem.HasValues (pitem, updateMode))
if (pitem != null && saveMode != ConfigurationSaveMode.Full) {
nitem.Unmerge (sitem, pitem, saveMode);
if (nitem.HasValues (pitem, saveMode))
BaseAdd (nitem);
} else {
nitem.Unmerge (sitem, null, ConfigurationSaveMode.Full);
@ -575,7 +575,7 @@ namespace System.Configuration
}
}
if (updateMode == ConfigurationSaveMode.Full)
if (saveMode == ConfigurationSaveMode.Full)
EmitClear = true;
else if (parent != null) {
for (int n=0; n<parent.Count; n++) {

View File

@ -49,60 +49,60 @@ namespace System.Configuration
: this (name, type, NoDefaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
{ }
public ConfigurationProperty (string name, Type type, object default_value)
: this (name, type, default_value, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
public ConfigurationProperty (string name, Type type, object defaultValue)
: this (name, type, defaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), ConfigurationPropertyOptions.None, null)
{ }
public ConfigurationProperty (
string name, Type type, object default_value,
ConfigurationPropertyOptions flags)
:this (name, type, default_value, TypeDescriptor.GetConverter (type), new DefaultValidator(), flags, null)
string name, Type type, object defaultValue,
ConfigurationPropertyOptions options)
:this (name, type, defaultValue, TypeDescriptor.GetConverter (type), new DefaultValidator(), options, null)
{ }
public ConfigurationProperty (
string name, Type type, object default_value,
TypeConverter converter,
ConfigurationValidatorBase validation,
ConfigurationPropertyOptions flags)
: this (name, type, default_value, converter, validation, flags, null)
string name, Type type, object defaultValue,
TypeConverter typeConverter,
ConfigurationValidatorBase validator,
ConfigurationPropertyOptions options)
: this (name, type, defaultValue, typeConverter, validator, options, null)
{ }
public ConfigurationProperty (
string name, Type type, object default_value,
TypeConverter converter,
ConfigurationValidatorBase validation,
ConfigurationPropertyOptions flags,
string name, Type type, object defaultValue,
TypeConverter typeConverter,
ConfigurationValidatorBase validator,
ConfigurationPropertyOptions options,
string description)
{
this.name = name;
this.converter = converter != null ? converter : TypeDescriptor.GetConverter (type);
if (default_value != null) {
if (default_value == NoDefaultValue) {
this.converter = typeConverter != null ? typeConverter : TypeDescriptor.GetConverter (type);
if (defaultValue != null) {
if (defaultValue == NoDefaultValue) {
switch (Type.GetTypeCode (type)) {
case TypeCode.Object:
default_value = null;
defaultValue = null;
break;
case TypeCode.String:
default_value = String.Empty;
defaultValue = String.Empty;
break;
default:
default_value = Activator.CreateInstance (type);
defaultValue = Activator.CreateInstance (type);
break;
}
}
else
if (!type.IsAssignableFrom (default_value.GetType ())) {
if (!this.converter.CanConvertFrom (default_value.GetType ()))
if (!type.IsAssignableFrom (defaultValue.GetType ())) {
if (!this.converter.CanConvertFrom (defaultValue.GetType ()))
throw new ConfigurationErrorsException (String.Format ("The default value for property '{0}' has a different type than the one of the property itself: expected {1} but was {2}",
name, type, default_value.GetType ()));
name, type, defaultValue.GetType ()));
default_value = this.converter.ConvertFrom (default_value);
defaultValue = this.converter.ConvertFrom (defaultValue);
}
}
this.default_value = default_value;
this.flags = flags;
this.default_value = defaultValue;
this.flags = options;
this.type = type;
this.validation = validation != null ? validation : new DefaultValidator ();
this.validation = validator != null ? validator : new DefaultValidator ();
this.description = description;
}

View File

@ -70,9 +70,9 @@ namespace System.Configuration
}
[MonoTODO]
public void ForceDeclaration (bool require)
public void ForceDeclaration (bool force)
{
this.require_declaration = require;
this.require_declaration = force;
}
public void ForceDeclaration ()

View File

@ -41,13 +41,13 @@ namespace System.Configuration
{
}
public new ConnectionStringSettings this [string Name]
public new ConnectionStringSettings this [string name]
{
get {
foreach (ConfigurationElement c in this) {
if (!(c is ConnectionStringSettings))
continue;
if (string.Compare(((ConnectionStringSettings) c).Name, Name, true,
if (string.Compare(((ConnectionStringSettings) c).Name, name, true,
System.Globalization.CultureInfo.InvariantCulture) == 0)
return c as ConnectionStringSettings;

View File

@ -38,7 +38,7 @@ namespace System.Configuration
Protection API, and is unimplemented in Mono. For portability's sake,
it is suggested that you use the RsaProtectedConfigurationProvider.";
[MonoNotSupported (NotSupportedReason)]
public override XmlNode Decrypt (XmlNode encrypted_node)
public override XmlNode Decrypt (XmlNode encryptedNode)
{
throw new NotSupportedException (NotSupportedReason);
}

View File

@ -54,15 +54,15 @@ namespace System.Configuration {
return false;
}
protected internal override void DeserializeSection (XmlReader reader)
protected internal override void DeserializeSection (XmlReader xmlReader)
{
xml = reader.ReadOuterXml ();
xml = xmlReader.ReadOuterXml ();
}
[MonoTODO]
protected internal override void Reset (ConfigurationElement parentElement)
protected internal override void Reset (ConfigurationElement parentSection)
{
base.Reset (parentElement);
base.Reset (parentSection);
}
[MonoTODO]
@ -71,7 +71,7 @@ namespace System.Configuration {
base.ResetModified ();
}
protected internal override string SerializeSection (ConfigurationElement parentElement, string name, ConfigurationSaveMode saveMode)
protected internal override string SerializeSection (ConfigurationElement parentSection, string name, ConfigurationSaveMode saveMode)
{
return xml;
}

View File

@ -330,7 +330,7 @@ namespace System.Configuration
CheckFileMap (level, map);
if (locationSubPath == null)
if (locationSubPath == null) {
switch (level) {
case ConfigurationUserLevel.PerUserRoaming:
if (map.RoamingUserConfigFilename == null)
@ -343,35 +343,37 @@ namespace System.Configuration
locationSubPath = "local";
break;
}
configPath = null;
string next = null;
locationConfigPath = null;
}
if (locationSubPath == "exe" || locationSubPath == null && map.ExeConfigFilename != null) {
configPath = "exe";
next = "machine";
locationSubPath = "machine";
locationConfigPath = map.ExeConfigFilename;
return;
}
if (locationSubPath == "local" && map.LocalUserConfigFilename != null) {
configPath = "local";
next = "roaming";
locationSubPath = "roaming";
locationConfigPath = map.LocalUserConfigFilename;
return;
}
if (locationSubPath == "roaming" && map.RoamingUserConfigFilename != null) {
configPath = "roaming";
next = "exe";
locationSubPath = "exe";
locationConfigPath = map.RoamingUserConfigFilename;
return;
}
if ((locationSubPath == "machine" || configPath == null) && map.MachineConfigFilename != null) {
if (locationSubPath == "machine" && map.MachineConfigFilename != null) {
configPath = "machine";
next = null;
locationSubPath = null;
locationConfigPath = null;
return;
}
locationSubPath = next;
throw new NotImplementedException ();
}
}

View File

@ -37,7 +37,7 @@ namespace System.Configuration
{
}
public abstract XmlNode Decrypt (XmlNode encrypted_node);
public abstract XmlNode Decrypt (XmlNode encryptedNode);
public abstract XmlNode Encrypt (XmlNode node);
}

View File

@ -89,10 +89,10 @@ namespace System.Configuration
[MonoTODO]
protected internal override void Unmerge (
ConfigurationElement source, ConfigurationElement parent,
ConfigurationSaveMode updateMode)
ConfigurationElement sourceElement, ConfigurationElement parentElement,
ConfigurationSaveMode saveMode)
{
base.Unmerge (source, parent, updateMode);
base.Unmerge (sourceElement, parentElement, saveMode);
}
[ConfigurationProperty ("name", Options = ConfigurationPropertyOptions.IsRequired | ConfigurationPropertyOptions.IsKey)]

View File

@ -58,15 +58,15 @@ namespace System.Configuration
return ((ProviderSettings)element).Name;
}
public void Remove (string key)
public void Remove (string name)
{
BaseRemove (key);
BaseRemove (name);
}
public ProviderSettings this [int n]
public ProviderSettings this [int index]
{
get { return (ProviderSettings) BaseGet (n); }
set { BaseAdd (n, value); }
get { return (ProviderSettings) BaseGet (index); }
set { BaseAdd (index, value); }
}
public new ProviderSettings this [string key]

View File

@ -63,11 +63,11 @@ namespace System.Configuration
}
[MonoTODO]
public override XmlNode Decrypt (XmlNode encrypted_node)
public override XmlNode Decrypt (XmlNode encryptedNode)
{
XmlDocument doc = new ConfigurationXmlDocument ();
doc.Load (new StringReader (encrypted_node.OuterXml));
doc.Load (new StringReader (encryptedNode.OuterXml));
EncryptedXml ex = new EncryptedXml (doc);

View File

@ -175,13 +175,13 @@ namespace System.Configuration
return raw_xml;
}
public void ProtectSection (string provider)
public void ProtectSection (string protectionProvider)
{
protection_provider = ProtectedConfiguration.GetProvider (provider, true);
protection_provider = ProtectedConfiguration.GetProvider (protectionProvider, true);
}
[MonoTODO]
public void ForceDeclaration (bool require)
public void ForceDeclaration (bool force)
{
}
@ -201,9 +201,9 @@ namespace System.Configuration
protection_provider = null;
}
public void SetRawXml (string xml)
public void SetRawXml (string rawXml)
{
raw_xml = xml;
raw_xml = rawXml;
}
[MonoTODO]

View File

@ -30,6 +30,6 @@ using System;
using System.IO;
namespace System.Configuration {
public delegate void ValidatorCallback (object o);
public delegate void ValidatorCallback (object value);
}