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)
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)
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)
{
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);
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);
[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 ();
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]];
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]];
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;
}
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;
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;
}
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)
}
[MonoTODO]
- protected virtual void ListErrors (IList list)
+ protected virtual void ListErrors (IList errorList)
{
throw new NotImplementedException ();
}
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);
return false;
}
- protected virtual bool OnDeserializeUnrecognizedElement (string element, XmlReader reader)
+ protected virtual bool OnDeserializeUnrecognizedElement (string elementName, XmlReader reader)
{
return false;
}
}
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;
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;
}
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 parentElementValue = (ConfigurationElement) parentValue;
ConfigurationElement copy = (ConfigurationElement) unmergedProp.Value;
- copy.Unmerge (sourceElementValue, parentElementValue, updateMode);
+ copy.Unmerge (sourceElementValue, parentElementValue, saveMode);
}
}
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;
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);
}
}
- if (updateMode == ConfigurationSaveMode.Full)
+ if (saveMode == ConfigurationSaveMode.Full)
EmitClear = true;
else if (parent != null) {
for (int n=0; n<parent.Count; n++) {
: 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;
}
}
[MonoTODO]
- public void ForceDeclaration (bool require)
+ public void ForceDeclaration (bool force)
{
- this.require_declaration = require;
+ this.require_declaration = force;
}
public void ForceDeclaration ()
{
}
- 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;
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);
}
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]
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;
}
{
}
- public abstract XmlNode Decrypt (XmlNode encrypted_node);
+ public abstract XmlNode Decrypt (XmlNode encryptedNode);
public abstract XmlNode Encrypt (XmlNode node);
}
[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)]
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]
}
[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);
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)
{
}
protection_provider = null;
}
- public void SetRawXml (string xml)
+ public void SetRawXml (string rawXml)
{
- raw_xml = xml;
+ raw_xml = rawXml;
}
[MonoTODO]
using System.IO;
namespace System.Configuration {
- public delegate void ValidatorCallback (object o);
+ public delegate void ValidatorCallback (object value);
}