ConfigurationElement Osztály
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Konfigurációs elemet jelöl egy konfigurációs fájlban.
public ref class ConfigurationElement abstract
public abstract class ConfigurationElement
type ConfigurationElement = class
Public MustInherit Class ConfigurationElement
- Öröklődés
-
ConfigurationElement
- Származtatott
Példák
Az alábbi példakód bemutatja, hogyan implementálhat egyéni ConfigurationElement elemeket egyéni szakasz egyes elemeiként és egy egyéni szakasz elemeinek gyűjteményeként. A példa a következő fájlokból áll:
Egy app.config fájl, amely egy egyéni, elnevezett
MyUrlsszakaszt tartalmaz. Ez a szakasz egy egyszerű elemet (más elemeket nem tartalmaz) és elemgyűjteményt tartalmaz. Az egyszerű elem nevesimpleés a gyűjtemény neveurls.Egy konzolalkalmazás. Az alkalmazás beolvassa a app.config fájl tartalmát, és az adatokat a konzolra írja. Olyan osztályokat használ, amelyek származnak az ConfigurationElement, ConfigurationElementCollectionés ConfigurationSectiona .
Egy osztály neve
UrlsSection, amely az ConfigurationSection osztályból származik. Ez az osztály a konfigurációs fájl szakaszának eléréséreMyUrlsszolgál.Egy osztály neve
UrlsCollection, amely az ConfigurationElementCollection osztályból származik. Ez az osztály a konfigurációs fájl gyűjteményénekurlselérésére szolgál.Egy osztály neve
UrlConfigElement, amely az ConfigurationElement osztályból származik. Ez az osztály a konfigurációs fájlban lévő elemhez és asimplegyűjtemény tagjaihoz való hozzáférésreurlsszolgál.
A példa futtatásához hajtsa végre a következő lépéseket:
Hozzon létre egy konzolalkalmazás-projektet és egy osztálytárprojektet tartalmazó
ConfigurationElementmegoldást.Helyezze a három osztályfájlt az osztálytár projektbe, és helyezze a többi fájlt a konzoltár projektbe.
Mindkét projektben állítson be egy hivatkozást a következőre
System.Configuration: .A konzolalkalmazás projektjében állítson be egy projekthivatkozást az osztálytár projektre.
// 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
Megjegyzések
Ez ConfigurationElement egy absztrakt osztály, amely egy konfigurációs fájl XML-elemének (például Web.config) ábrázolására szolgál. A konfigurációs fájl elemei nulla, egy vagy több gyermekelemet tartalmazhatnak.
Mivel az ConfigurationElement osztály absztraktként van definiálva, nem hozható létre példánya. Csak osztályok származtathatók belőle. A .NET-keretrendszer olyan osztályokat tartalmaz, amelyek a ConfigurationElement osztályból származnak, hogy szabványos XML-konfigurációs elemeket, például ConfigurationSection képviseljenek. Az osztályt kiterjesztheti az ConfigurationElement egyéni konfigurációs elemek és szakaszok elérésére is. A jelen témakör későbbi részében szereplő példa bemutatja, hogyan érheti el az egyéni konfigurációs elemeket és szakaszokat a forrásból ConfigurationElementszármazó egyéni osztályok használatával.
Kiterjesztheti a szabványos konfigurációs típusokat is, például ConfigurationElement, ConfigurationElementCollection, ConfigurationPropertyés ConfigurationSection. További információkért tekintse meg az osztályok dokumentációját.
A konfigurációs fájlokban lévő információk eléréséről az osztály és az ConfigurationManagerWebConfigurationManager osztály nyújt további információt.
Megjegyzések az implementálókhoz
Minden ConfigurationElement objektum létrehoz egy belső ConfigurationPropertyCollection objektumgyűjteményt ConfigurationProperty , amely az elemattribútumokat vagy a gyermekelemek gyűjteményét jelöli.
A nem testre szabható információkat és funkciókat a ElementInformation tulajdonság által ElementInformation biztosított objektum tartalmazza.
Egyéni konfigurációelem létrehozásához programozott vagy deklaratív (attribútummal ellátott) kódolási modellt is használhat:
A programozott modell megköveteli, hogy minden elemattribútumhoz hozzon létre egy tulajdonságot, amely lekéri vagy beállítja annak értékét, és hozzáadja azt az alapul szolgáló ConfigurationElement alaposztály belső tulajdonságcsomagjához. A modell használatára példaként tekintse meg az osztályt ConfigurationSection .
Az egyszerűbb deklaratív modell, más néven az attribútumos modell lehetővé teszi egy elemattribútum definiálását egy tulajdonság használatával, majd attribútumokkal díszítve. Ezek az attribútumok ismertetik a ASP.NET konfigurációs rendszert a tulajdonságtípusokról és azok alapértelmezett értékeiről. A tükröződés útján beszerzett információk alapján a ASP.NET konfigurációs rendszer létrehozza az elemtulajdonság-objektumokat, és végrehajtja a szükséges inicializálást. A jelen témakör későbbi részében látható példa bemutatja, hogyan használhatja ezt a modellt.
Konstruktorok
| Name | Description |
|---|---|
| ConfigurationElement() |
Inicializálja a ConfigurationElement osztály új példányát. |
Tulajdonságok
| Name | Description |
|---|---|
| CurrentConfiguration |
Lekéri a legfelső szintű Configuration példányra mutató hivatkozást, amely az aktuális ConfigurationElement példány konfigurációs hierarchiáját jelöli. |
| ElementInformation |
ElementInformation Lekéri az objektum nem testre szabható adatait és funkcióit ConfigurationElement tartalmazó objektumot. |
| ElementProperty |
Lekéri az ConfigurationElementProperty objektumot jelképező ConfigurationElement objektumot. |
| EvaluationContext |
Lekéri az ContextInformation objektum objektumát ConfigurationElement . |
| HasContext |
Olyan értéket kap, amely jelzi, hogy a CurrentConfiguration tulajdonság . |
| Item[ConfigurationProperty] |
Lekéri vagy beállítja ennek a konfigurációelemnek a tulajdonságát vagy attribútumát. |
| Item[String] |
Lekéri vagy beállítja ennek a konfigurációelemnek a tulajdonságát, attribútumát vagy gyermekelemét. |
| LockAllAttributesExcept |
Lekéri a zárolt attribútumok gyűjteményét. |
| LockAllElementsExcept |
Lekéri a zárolt elemek gyűjteményét. |
| LockAttributes |
Lekéri a zárolt attribútumok gyűjteményét. |
| LockElements |
Lekéri a zárolt elemek gyűjteményét. |
| LockItem |
Lekéri vagy beállít egy értéket, amely jelzi, hogy az elem zárolva van-e. |
| Properties |
Lekéri a tulajdonságok gyűjteményét. |
Metódusok
| Name | Description |
|---|---|
| DeserializeElement(XmlReader, Boolean) |
Beolvassa az XML-t a konfigurációs fájlból. |
| Equals(Object) |
Összehasonlítja az aktuális ConfigurationElement példányt a megadott objektummal. |
| GetHashCode() |
Az aktuális ConfigurationElement példányt jelképező egyedi értéket kap. |
| GetTransformedAssemblyString(String) |
A megadott szerelvénynév átalakított verzióját adja vissza. |
| GetTransformedTypeString(String) |
A megadott típusnév átalakított verzióját adja vissza. |
| GetType() |
Lekéri az Type aktuális példányt. (Öröklődés forrása Object) |
| Init() |
Beállítja az ConfigurationElement objektumot a kezdeti állapotára. |
| InitializeDefault() |
Az objektum alapértelmezett értékkészletének inicializálására ConfigurationElement szolgál. |
| IsModified() |
Azt jelzi, hogy ez a konfigurációs elem módosult-e a legutóbbi mentés vagy betöltés óta, amikor egy származtatott osztályban implementálták. |
| IsReadOnly() |
Beolvas egy értéket, amely jelzi, hogy az ConfigurationElement objektum írásvédett-e. |
| ListErrors(IList) |
Hozzáadja az objektumban és az összes alelemben található ConfigurationElement érvénytelen tulajdonsághibákat az átadott listához. |
| MemberwiseClone() |
Az aktuális Objectpéldány sekély másolatát hozza létre. (Öröklődés forrása Object) |
| OnDeserializeUnrecognizedAttribute(String, String) |
Beolvas egy értéket, amely jelzi, hogy a deszerializálás során ismeretlen attribútumot észleltek-e. |
| OnDeserializeUnrecognizedElement(String, XmlReader) |
Lekéri az értéket, amely jelzi, hogy ismeretlen elem jelenik-e meg a deszerializálás során. |
| OnRequiredPropertyNotFound(String) |
Kivételt eredményez, ha a szükséges tulajdonság nem található. |
| PostDeserialize() |
A deszerializálás után hívjuk. |
| PreSerialize(XmlWriter) |
A szerializálás előtt hívjuk meg. |
| Reset(ConfigurationElement) |
Alaphelyzetbe állítja az ConfigurationElement objektum belső állapotát, beleértve a zárolásokat és a tulajdonságok gyűjteményeit. |
| ResetModified() |
A metódus IsModified() értékét |
| SerializeElement(XmlWriter, Boolean) |
Ennek a konfigurációelemnek a tartalmát írja a konfigurációs fájlba, amikor egy származtatott osztályban implementálják. |
| SerializeToXmlElement(XmlWriter, String) |
A konfigurációelem külső címkéit a konfigurációs fájlba írja, amikor egy származtatott osztályban implementálják. |
| SetPropertyValue(ConfigurationProperty, Object, Boolean) |
Beállít egy tulajdonságot a megadott értékre. |
| SetReadOnly() |
Beállítja az IsReadOnly() objektum és az ConfigurationElement összes alelem tulajdonságát. |
| ToString() |
Az aktuális objektumot jelképező sztringet ad vissza. (Öröklődés forrása Object) |
| Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode) |
Módosítja az objektumot, ConfigurationElement hogy eltávolítsa az összes olyan értéket, amelyet nem szabad menteni. |