ConfigurationElement Clase

Definición

Representa un elemento de configuración de un archivo de configuración.

public ref class ConfigurationElement abstract
public abstract class ConfigurationElement
type ConfigurationElement = class
Public MustInherit Class ConfigurationElement
Herencia
ConfigurationElement
Derivado

Ejemplos

En el ejemplo de código siguiente se muestra cómo implementar un elemento personalizado ConfigurationElement como un elemento individual en una sección personalizada y como una colección de elementos de una sección personalizada. El ejemplo consta de los siguientes archivos:

  • Un archivo app.config que contiene una sección personalizada denominada MyUrls. Esta sección contiene un elemento simple (no contiene ningún otro elemento) y una colección de elementos. El elemento simple se denomina simple y la colección se denomina urls.

  • Una aplicación de consola. La aplicación lee el contenido del archivo app.config y escribe la información en la consola. Usa clases que derivan de ConfigurationElement, ConfigurationElementCollectiony ConfigurationSection.

  • Clase denominada UrlsSection que deriva de la ConfigurationSection clase . Esta clase se usa para acceder a la MyUrls sección del archivo de configuración.

  • Clase denominada UrlsCollection que deriva de la ConfigurationElementCollection clase . Esta clase se usa para tener acceso a la urls colección en el archivo de configuración.

  • Clase denominada UrlConfigElement que deriva de la ConfigurationElement clase . Esta clase se usa para tener acceso al simple elemento y a los miembros de la urls colección en el archivo de configuración.

Para ejecutar el ejemplo, realice los pasos siguientes:

  1. Cree una solución que tenga un proyecto de aplicación de consola y un proyecto de biblioteca de clases denominado ConfigurationElement.

  2. Coloque los tres archivos de clase en el proyecto de biblioteca de clases y coloque los demás archivos en el proyecto de biblioteca de consola.

  3. En ambos proyectos, establezca una referencia a System.Configuration.

  4. En el proyecto de aplicación de consola, establezca una referencia de proyecto al proyecto de biblioteca de clases.

// Set Assembly name to ConfigurationElement
using System;
using System.Configuration;
using System.Collections;

namespace Samples.AspNet
{
    // Entry point for console application that reads the 
    // app.config file and writes to the console the 
    // URLs in the custom section.  
    class TestConfigurationElement
    {
        static void Main(string[] args)
        {
            // Get current configuration file.
            System.Configuration.Configuration config =
                ConfigurationManager.OpenExeConfiguration(
                ConfigurationUserLevel.None);

            // Get the MyUrls section.
            UrlsSection myUrlsSection =
                config.GetSection("MyUrls") as UrlsSection;

            if (myUrlsSection == null)
            {
                Console.WriteLine("Failed to load UrlsSection.");
            }
            else
            {
                Console.WriteLine("The 'simple' element of app.config:");
                Console.WriteLine("  Name={0} URL={1} Port={2}",
                    myUrlsSection.Simple.Name,
                    myUrlsSection.Simple.Url,
                    myUrlsSection.Simple.Port);

                Console.WriteLine("The urls collection of app.config:");
                for (int i = 0; i < myUrlsSection.Urls.Count; i++)
                {
                    Console.WriteLine("  Name={0} URL={1} Port={2}",
                        myUrlsSection.Urls[i].Name,
                        myUrlsSection.Urls[i].Url,
                        myUrlsSection.Urls[i].Port);
                }
            }
            Console.ReadLine();
        }
    }
}
' Set Assembly name to ConfigurationElement
' and set Root namespace to Samples.AspNet
Imports System.Configuration
Imports System.Collections

Class TestConfigurationElement
    ' Entry point for console application that reads the 
    ' app.config file and writes to the console the 
    ' URLs in the custom section.
    Shared Sub Main(ByVal args() As String)
        ' Get the current configuration file.
        Dim config As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration( _
            ConfigurationUserLevel.None)

        ' Get the MyUrls section.
        Dim myUrlsSection As UrlsSection = _
            config.GetSection("MyUrls")

        If myUrlsSection Is Nothing Then
            Console.WriteLine("Failed to load UrlsSection.")
        Else
            Console.WriteLine("The 'simple' element of app.config:")
            Console.WriteLine("  Name={0} URL={1} Port={2}", _
                myUrlsSection.Simple.Name, _
                myUrlsSection.Simple.Url, _
                myUrlsSection.Simple.Port)
            Console.WriteLine("The urls collection of app.config:")
            Dim i As Integer
            For i = 0 To myUrlsSection.Urls.Count - 1
                Console.WriteLine("  Name={0} URL={1} Port={2}", _
                i, myUrlsSection.Urls(i).Name, _
                myUrlsSection.Urls(i).Url, _
                myUrlsSection.Urls(i).Port)
            Next i
        End If
        Console.ReadLine()
    End Sub
End Class
using System;
using System.Configuration;
using System.Collections;

namespace Samples.AspNet
{
    // Define a custom section containing an individual
    // element and a collection of elements.
    public class UrlsSection : ConfigurationSection
    {
        [ConfigurationProperty("name", 
            DefaultValue = "MyFavorites",
            IsRequired = true, 
            IsKey = false)]
        [StringValidator(InvalidCharacters = 
            " ~!@#$%^&*()[]{}/;'\"|\\",
            MinLength = 1, MaxLength = 60)]
        public string Name
        {

            get
            {
                return (string)this["name"];
            }
            set
            {
                this["name"] = value;
            }
        }

        // Declare an element (not in a collection) of the type
        // UrlConfigElement. In the configuration
        // file it corresponds to <simple .... />.
        [ConfigurationProperty("simple")]
        public UrlConfigElement Simple
        {
            get
            {
                UrlConfigElement url =
                (UrlConfigElement)base["simple"];
                return url;
            }
        }

        // Declare a collection element represented 
        // in the configuration file by the sub-section
        // <urls> <add .../> </urls> 
        // Note: the "IsDefaultCollection = false" 
        // instructs the .NET Framework to build a nested 
        // section like <urls> ...</urls>.
        [ConfigurationProperty("urls",
            IsDefaultCollection = false)]
        public UrlsCollection Urls
        {
            get
            {
                UrlsCollection urlsCollection =
                (UrlsCollection)base["urls"];
                return urlsCollection;
            }
        }

        protected override void DeserializeSection(
            System.Xml.XmlReader reader)
        {
            base.DeserializeSection(reader);
            // You can add custom processing code here.
        }

        protected override string SerializeSection(
            ConfigurationElement parentElement,
            string name, ConfigurationSaveMode saveMode)
        {
            string s =
                base.SerializeSection(parentElement,
                name, saveMode);
            // You can add custom processing code here.
            return s;
        }
    }
}
Imports System.Configuration
Imports System.Collections

' Define a custom section containing an individual
' element and a collection of elements.
Public Class UrlsSection
    Inherits ConfigurationSection

    <ConfigurationProperty("name", _
        DefaultValue:="MyFavorites", _
        IsRequired:=True, _
        IsKey:=False), _
        StringValidator( _
        InvalidCharacters:=" ~!@#$%^&*()[]{}/;'""|\", _
        MinLength:=1, MaxLength:=60)> _
        Public Property Name() As String

        Get
            Return CStr(Me("name"))
        End Get
        Set(ByVal value As String)
            Me("name") = value
        End Set
    End Property
    
    ' Declare an element (not in a collection) of the type
    ' UrlConfigElement. In the configuration
    ' file it corresponds to <simple .... />.
    <ConfigurationProperty("simple")> _
        Public ReadOnly Property Simple() _
        As UrlConfigElement

        Get
            Dim url As UrlConfigElement = _
                CType(Me("simple"),  _
                UrlConfigElement)
            Return url
        End Get
    End Property
    
    ' Declare a collection element represented 
    ' in the configuration file by the sub-section
    ' <urls> <add .../> </urls> 
    ' Note: the "IsDefaultCollection = false" 
    ' instructs the .NET Framework to build a nested 
    ' section like <urls> ...</urls>.
    <ConfigurationProperty("urls", _
        IsDefaultCollection:=False)> _
        Public ReadOnly Property Urls() _
        As UrlsCollection

        Get
            Dim urlsCollection _
                As UrlsCollection = _
                CType(Me("urls"), UrlsCollection)
            Return urlsCollection
        End Get
    End Property

    Protected Overrides Sub DeserializeSection( _
        ByVal reader As System.Xml.XmlReader)

        MyBase.DeserializeSection(reader)
        ' Enter your custom processing code here.
    End Sub

    Protected Overrides Function SerializeSection( _
        ByVal parentElement As ConfigurationElement, _
        ByVal name As String, _
        ByVal saveMode As ConfigurationSaveMode) As String

        Dim s As String = _
            MyBase.SerializeSection(parentElement, _
            name, saveMode)
        ' Enter your custom processing code here.
        Return s
    End Function 'SerializeSection
End Class
using System;
using System.Configuration;
using System.Collections;

namespace Samples.AspNet
{
    public class UrlsCollection : ConfigurationElementCollection
    {
        public UrlsCollection()
        {
            // Add one url to the collection.  This is
            // not necessary; could leave the collection 
            // empty until items are added to it outside
            // the constructor.
            UrlConfigElement url = 
                (UrlConfigElement)CreateNewElement();
            Add(url);
        }

        public override 
            ConfigurationElementCollectionType CollectionType
        {
            get
            {
                return 

                    ConfigurationElementCollectionType.AddRemoveClearMap;
            }
        }

        protected override 
            ConfigurationElement CreateNewElement()
        {
            return new UrlConfigElement();
        }

        protected override 
            ConfigurationElement CreateNewElement(
            string elementName)
        {
            return new UrlConfigElement(elementName);
        }

        protected override Object 
            GetElementKey(ConfigurationElement element)
        {
            return ((UrlConfigElement)element).Name;
        }

        public new string AddElementName
        {
            get
            { return base.AddElementName; }

            set
            { base.AddElementName = value; }
        }

        public new string ClearElementName
        {
            get
            { return base.ClearElementName; }

            set
            { base.ClearElementName = value; }
        }

        public new string RemoveElementName
        {
            get
            { return base.RemoveElementName; }
        }

        public new int Count
        {
            get { return base.Count; }
        }

        public UrlConfigElement this[int index]
        {
            get
            {
                return (UrlConfigElement)BaseGet(index);
            }
            set
            {
                if (BaseGet(index) != null)
                {
                    BaseRemoveAt(index);
                }
                BaseAdd(index, value);
            }
        }

        new public UrlConfigElement this[string Name]
        {
            get
            {
                return (UrlConfigElement)BaseGet(Name);
            }
        }

        public int IndexOf(UrlConfigElement url)
        {
            return BaseIndexOf(url);
        }

        public void Add(UrlConfigElement url)
        {
            BaseAdd(url);
            // Add custom code here.
        }

        protected override void 
            BaseAdd(ConfigurationElement element)
        {
            BaseAdd(element, false);
            // Add custom code here.
        }

        public void Remove(UrlConfigElement url)
        {
            if (BaseIndexOf(url) >= 0)
                BaseRemove(url.Name);
        }

        public void RemoveAt(int index)
        {
            BaseRemoveAt(index);
        }

        public void Remove(string name)
        {
            BaseRemove(name);
        }

        public void Clear()
        {
            BaseClear();
            // Add custom code here.
        }
    }
}
Imports System.Configuration
Imports System.Collections

Public Class UrlsCollection
    Inherits ConfigurationElementCollection

    Public Sub New()
        ' Add one url to the collection.  This is
        ' not necessary; could leave the collection 
        ' empty until items are added to it outside
        ' the constructor.
        Dim url As UrlConfigElement = _
            CType(CreateNewElement(), UrlConfigElement)
        ' Add the element to the collection.
        Add(url)
    End Sub

    Public Overrides ReadOnly Property CollectionType() _
        As ConfigurationElementCollectionType

        Get
            Return ConfigurationElementCollectionType.AddRemoveClearMap
        End Get
    End Property

    Protected Overloads Overrides Function CreateNewElement() _
        As ConfigurationElement

        Return New UrlConfigElement()
    End Function 'CreateNewElement

    Protected Overloads Overrides Function CreateNewElement( _
        ByVal elementName As String) _
        As ConfigurationElement

        Return New UrlConfigElement(elementName)
    End Function 'CreateNewElement

    Protected Overrides Function GetElementKey( _
        ByVal element As ConfigurationElement) As [Object]

        Return CType(element, UrlConfigElement).Name
    End Function 'GetElementKey

    Public Shadows Property AddElementName() As String

        Get
            Return MyBase.AddElementName
        End Get

        Set(ByVal value As String)
            MyBase.AddElementName = value
        End Set
    End Property

    Public Shadows Property ClearElementName() As String
        Get
            Return MyBase.ClearElementName
        End Get

        Set(ByVal value As String)
            MyBase.ClearElementName = value
        End Set
    End Property

    Public Shadows ReadOnly Property RemoveElementName() As String
        Get
            Return MyBase.RemoveElementName
        End Get
    End Property

    Public Shadows ReadOnly Property Count() As Integer
        Get
            Return MyBase.Count
        End Get
    End Property

    Default Public Shadows Property Item( _
    ByVal index As Integer) As UrlConfigElement
        Get
            Return CType(BaseGet(index), UrlConfigElement)
        End Get

        Set(ByVal value As UrlConfigElement)
            If Not (BaseGet(index) Is Nothing) Then
                BaseRemoveAt(index)
            End If
            BaseAdd(index, value)
        End Set
    End Property

    Default Public Shadows ReadOnly Property Item( _
        ByVal Name As String) As UrlConfigElement

        Get
            Return CType(BaseGet(Name), UrlConfigElement)
        End Get
    End Property

    Public Function IndexOf( _
        ByVal url As UrlConfigElement) As Integer

        Return BaseIndexOf(url)
    End Function 'IndexOf

    Public Sub Add(ByVal url As UrlConfigElement)
        BaseAdd(url)
        ' Add custom code here.
    End Sub

    Protected Overrides Sub BaseAdd( _
    ByVal element As ConfigurationElement)
        BaseAdd(element, False)
        ' Add custom code here.
    End Sub

    Public Overloads Sub Remove( _
        ByVal url As UrlConfigElement)

        If BaseIndexOf(url) >= 0 Then
            BaseRemove(url.Name)
        End If
    End Sub

    Public Sub RemoveAt(ByVal index As Integer)
        BaseRemoveAt(index)
    End Sub

    Public Overloads Sub Remove(ByVal name As String)
        BaseRemove(name)
    End Sub

    Public Sub Clear()
        BaseClear()
    End Sub
End Class
using System;
using System.Configuration;
using System.Collections;

namespace Samples.AspNet
{
    public class UrlConfigElement : ConfigurationElement
    {
        // Constructor allowing name, url, and port to be specified.
        public UrlConfigElement(String newName,
            String newUrl, int newPort)
        {
            Name = newName;
            Url = newUrl;
            Port = newPort;
        }

        // Default constructor, will use default values as defined
        // below.
        public UrlConfigElement()
        {
        }

        // Constructor allowing name to be specified, will take the
        // default values for url and port.
        public UrlConfigElement(string elementName)
        {
            Name = elementName;
        }

        [ConfigurationProperty("name", 
            DefaultValue = "Microsoft",
            IsRequired = true, 
            IsKey = true)]
        public string Name
        {
            get
            {
                return (string)this["name"];
            }
            set
            {
                this["name"] = value;
            }
        }

        [ConfigurationProperty("url",
            DefaultValue = "http://www.microsoft.com",
            IsRequired = true)]
        [RegexStringValidator(@"\w+:\/\/[\w.]+\S*")]
        public string Url
        {
            get
            {
                return (string)this["url"];
            }
            set
            {
                this["url"] = value;
            }
        }

        [ConfigurationProperty("port",
            DefaultValue = (int)0,
            IsRequired = false)]
        [IntegerValidator(MinValue = 0,
            MaxValue = 8080, ExcludeRange = false)]
        public int Port
        {
            get
            {
                return (int)this["port"];
            }
            set
            {
                this["port"] = value;
            }
        }

        protected override void DeserializeElement(
           System.Xml.XmlReader reader, 
            bool serializeCollectionKey)
        {
            base.DeserializeElement(reader, 
                serializeCollectionKey);
            // You can your custom processing code here.
        }

        protected override bool SerializeElement(
            System.Xml.XmlWriter writer, 
            bool serializeCollectionKey)
        {
            bool ret = base.SerializeElement(writer, 
                serializeCollectionKey);
            // You can enter your custom processing code here.
            return ret;
        }

        protected override bool IsModified()
        {
            bool ret = base.IsModified();
            // You can enter your custom processing code here.
            return ret;
        }
    }
}
Imports System.Configuration
Imports System.Collections

Public Class UrlConfigElement
    Inherits ConfigurationElement

    ' Constructor allowing name, url, and port to be specified.
    Public Sub New(ByVal newName As String, _
        ByVal newUrl As String, _
        ByVal newPort As Integer)

        Name = newName
        Url = newUrl
        Port = newPort

    End Sub

    ' Default constructor, will use default values as defined
    Public Sub New()

    End Sub


    ' Constructor allowing name to be specified, will take the
    ' default values for url and port.
    Public Sub New(ByVal elementName As String)
        Name = elementName

    End Sub


    <ConfigurationProperty("name", _
        DefaultValue:="Microsoft", _
        IsRequired:=True, _
        IsKey:=True)> _
        Public Property Name() As String

        Get
            Return CStr(Me("name"))
        End Get
        Set(ByVal value As String)
            Me("name") = value
        End Set
    End Property


    <ConfigurationProperty("url", _
        DefaultValue:="http://www.microsoft.com", _
        IsRequired:=True), _
        RegexStringValidator("\w+:\/\/[\w.]+\S*")> _
        Public Property Url() As String

        Get
            Return CStr(Me("url"))
        End Get
        Set(ByVal value As String)
            Me("url") = value
        End Set
    End Property


    <ConfigurationProperty("port", _
        DefaultValue:=0, _
        IsRequired:=False), _
        IntegerValidator(MinValue:=0, _
        MaxValue:=8080, ExcludeRange:=False)> _
        Public Property Port() As Integer

        Get
            Return Fix(Me("port"))
        End Get
        Set(ByVal value As Integer)
            Me("port") = value
        End Set
    End Property


    Protected Overrides Sub DeserializeElement(ByVal reader _
        As System.Xml.XmlReader, _
        ByVal serializeCollectionKey As Boolean)

        MyBase.DeserializeElement(reader, _
            serializeCollectionKey)
        ' Enter your custom processing code here.
    End Sub

    Protected Overrides Function SerializeElement(ByVal writer _
        As System.Xml.XmlWriter, _
        ByVal serializeCollectionKey As Boolean) As Boolean

        Dim ret As Boolean = _
            MyBase.SerializeElement(writer, serializeCollectionKey)
        ' Enter your custom processing code here.
        Return ret
    End Function 'SerializeElement

    Protected Overrides Function IsModified() As Boolean
        Dim ret As Boolean = MyBase.IsModified()
        ' Enter your custom processing code here.
        Return ret

    End Function 'IsModified
End Class

Comentarios

ConfigurationElement es una clase abstracta que se usa para representar un elemento XML en un archivo de configuración (como Web.config). Un elemento de un archivo de configuración puede contener cero, uno o más elementos secundarios.

Dado que la ConfigurationElement clase se define como abstracta, no se puede crear una instancia de ella. Solo puede derivar clases de ella. .NET Framework incluye clases que derivan de la ConfigurationElement clase para representar elementos de configuración XML estándar, como ConfigurationSection. También puede ampliar la ConfigurationElement clase para acceder a secciones y elementos de configuración personalizados. En el ejemplo que se incluye más adelante en este tema se muestra cómo obtener acceso a elementos y secciones de configuración personalizados mediante clases personalizadas que derivan de ConfigurationElement.

También puede ampliar los tipos de configuración estándar, como ConfigurationElement, ConfigurationElementCollection, ConfigurationPropertyy ConfigurationSection. Para obtener más información, consulte la documentación de esas clases.

Para obtener más información sobre cómo obtener acceso a la información de los archivos de configuración, vea la ConfigurationManager clase y la WebConfigurationManager clase .

Notas a los implementadores

Cada ConfigurationElement objeto crea una colección interna ConfigurationPropertyCollection de ConfigurationProperty objetos que representa los atributos de elemento o una colección de elementos secundarios.

La información y la funcionalidad no personalizables están contenidas en un ElementInformation objeto proporcionado por la ElementInformation propiedad .

Puede usar un modelo de codificación mediante programación o declarativo (con atributos) para crear un elemento de configuración personalizado:

  • El modelo de programación requiere que, para cada atributo de elemento, cree una propiedad para obtener o establecer su valor y agregarla al contenedor de propiedades interno de la clase base subyacente ConfigurationElement . Para obtener un ejemplo de cómo usar este modelo, vea la ConfigurationSection clase .

  • El modelo declarativo más sencillo, también denominado modelo con atributos, permite definir un atributo de elemento mediante una propiedad y, a continuación, decorarlo con atributos. Estos atributos indican al sistema de configuración ASP.NET sobre los tipos de propiedad y sus valores predeterminados. Con esta información, obtenida a través de la reflexión, el sistema de configuración de ASP.NET crea automáticamente los objetos de propiedad de elemento y realiza la inicialización necesaria. En el ejemplo que se muestra más adelante en este tema se muestra cómo usar este modelo.

Constructores

ConfigurationElement()

Inicializa una nueva instancia de la clase ConfigurationElement.

Propiedades

CurrentConfiguration

Obtiene una referencia a la instancia de Configuration de nivel superior que representa la jerarquía de configuración a la que pertenece la instancia actual de ConfigurationElement.

ElementInformation

Obtiene un objeto ElementInformation que contiene la funcionalidad e información no personalizable del objeto ConfigurationElement.

ElementProperty

Obtiene el objeto ConfigurationElementProperty que representa al propio objeto ConfigurationElement.

EvaluationContext

Obtiene el objeto ContextInformation para el objeto ConfigurationElement.

HasContext

Obtiene un valor que indica si la propiedad CurrentConfiguration es null.

Item[ConfigurationProperty]

Obtiene o establece una propiedad o atributo de este elemento de configuración.

Item[String]

Obtiene o establece una propiedad, un atributo o un elemento secundario de este elemento de configuración.

LockAllAttributesExcept

Obtiene la colección de atributos bloqueados.

LockAllElementsExcept

Obtiene la colección de elementos bloqueados.

LockAttributes

Obtiene la colección de atributos bloqueados.

LockElements

Obtiene la colección de elementos bloqueados.

LockItem

Obtiene o establece un valor que indica si el elemento está bloqueado.

Properties

Obtiene la colección de propiedades.

Métodos

DeserializeElement(XmlReader, Boolean)

Lee XML del archivo de configuración.

Equals(Object)

Compara la instancia actual de ConfigurationElement con el objeto especificado.

GetHashCode()

Obtiene un valor único que representa la instancia actual de ConfigurationElement.

GetTransformedAssemblyString(String)

Devuelve la versión transformada del nombre de ensamblado especificado.

GetTransformedTypeString(String)

Devuelve la versión transformada del nombre de tipo especificado.

GetType()

Obtiene el Type de la instancia actual.

(Heredado de Object)
Init()

Establece el objeto ConfigurationElement en su estado inicial.

InitializeDefault()

Se utiliza para inicializar un conjunto predeterminado de valores para el objeto ConfigurationElement.

IsModified()

Indica si se ha modificado este elemento de configuración desde la última vez en que se guardo o cargó al implementarlo en una clase derivada.

IsReadOnly()

Obtiene un valor que indica si el objeto ConfigurationElement es de solo lectura.

ListErrors(IList)

Agrega a la lista que se pasa los errores de propiedad no válida que hay en este objeto ConfigurationElement y en todos los subelementos.

MemberwiseClone()

Crea una copia superficial del Object actual.

(Heredado de Object)
OnDeserializeUnrecognizedAttribute(String, String)

Obtiene un valor que indica si se ha encontrado un atributo desconocido durante la deserialización.

OnDeserializeUnrecognizedElement(String, XmlReader)

Obtiene un valor que indica si se ha encontrado un elemento desconocido durante la deserialización.

OnRequiredPropertyNotFound(String)

Se inicia una excepción cuando no se encuentra una propiedad necesaria.

PostDeserialize()

Se llama a este método después de la deserialización.

PreSerialize(XmlWriter)

Se llama a este método antes de la serialización.

Reset(ConfigurationElement)

Restablece el estado interno del objeto ConfigurationElement, incluyendo los bloqueos y las colecciones de propiedades.

ResetModified()

Restablece el valor del método IsModified() en false cuando se implementa en una clase derivada.

SerializeElement(XmlWriter, Boolean)

Escribe el contenido de este elemento de configuración en el archivo de configuración cuando se implementa en una clase derivada.

SerializeToXmlElement(XmlWriter, String)

Escribe las etiquetas externas de este elemento de configuración en el archivo de configuración cuando se implementa en una clase derivada.

SetPropertyValue(ConfigurationProperty, Object, Boolean)

Establece una propiedad en el valor especificado.

SetReadOnly()

Establece la propiedad IsReadOnly() para el objeto ConfigurationElement y todos los subelementos.

ToString()

Devuelve una cadena que representa el objeto actual.

(Heredado de Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Modifica el objeto ConfigurationElement para quitar todos los valores que no se deben guardar.

Se aplica a

Consulte también