İngilizce dilinde oku

Aracılığıyla paylaş


ConfigurationElementCollection Sınıf

Tanım

Alt öğe koleksiyonunu içeren bir yapılandırma öğesini temsil eder.

public abstract class ConfigurationElementCollection : System.Configuration.ConfigurationElement, System.Collections.ICollection
Devralma
ConfigurationElementCollection
Türetilmiş
Uygulamalar

Örnekler

Aşağıdaki örnekte, uygulamasının nasıl kullanılacağı gösterilmektedir ConfigurationElementCollection.

İlk örnek üç sınıftan oluşur: UrlsSection, UrlsCollection ve UrlConfigElement. sınıfı, UrlsSection özel bir yapılandırma bölümü tanımlamak için öğesini ConfigurationCollectionAttribute kullanır. Bu bölüm, URL öğelerinin UrlsCollection (sınıf tarafından tanımlanan) bir URL koleksiyonunu (sınıfı tarafından UrlConfigElement tanımlanır) içerir.

using System;
using System.Configuration;

// Define a UrlsSection custom section that contains a 
// UrlsCollection collection of UrlConfigElement elements.
public class UrlsSection : ConfigurationSection
{

    // Declare the UrlsCollection collection property.
    [ConfigurationProperty("urls", IsDefaultCollection = false)]
    [ConfigurationCollection(typeof(UrlsCollection),
        AddItemName = "add",
        ClearItemsName = "clear",
        RemoveItemName = "remove")]
    public UrlsCollection Urls
    {
        get
        {
            UrlsCollection urlsCollection =
                (UrlsCollection)base["urls"];

            return urlsCollection;
        }

        set
        {
            UrlsCollection urlsCollection = value;
        }
    }

    // Create a new instance of the UrlsSection.
    // This constructor creates a configuration element 
    // using the UrlConfigElement default values.
    // It assigns this element to the collection.
    public UrlsSection()
    {
        UrlConfigElement url = new UrlConfigElement();
        Urls.Add(url);
    }
}

// Define the UrlsCollection that contains the 
// UrlsConfigElement elements.
// This class shows how to use the ConfigurationElementCollection.
public class UrlsCollection : ConfigurationElementCollection
{

    public UrlsCollection()
    {
    }

    public override ConfigurationElementCollectionType CollectionType
    {
        get
        {
            return ConfigurationElementCollectionType.AddRemoveClearMap;
        }
    }

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

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

    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);

        // Your custom code goes here.
    }

    protected override void BaseAdd(ConfigurationElement element)
    {
        BaseAdd(element, false);

        // Your custom code goes here.
    }
    
    public void Remove(UrlConfigElement url)
    {
        if (BaseIndexOf(url) >= 0)
        {
            BaseRemove(url.Name);
            // Your custom code goes here.
            Console.WriteLine("UrlsCollection: {0}", "Removed collection element!");
        }
    }
    
    public void RemoveAt(int index)
    {
        BaseRemoveAt(index);

        // Your custom code goes here.
    }
    
    public void Remove(string name)
    {
        BaseRemove(name);

        // Your custom code goes here.
    }
    
    public void Clear()
    {
        BaseClear();

        // Your custom code goes here.
        Console.WriteLine("UrlsCollection: {0}", "Removed entire collection!");
    }
}

// Define the UrlsConfigElement elements that are contained 
// by the UrlsCollection.
public class UrlConfigElement : ConfigurationElement
{
    public UrlConfigElement(String name, String url, int port)
    {
        this.Name = name;
        this.Url = url;
        this.Port = port;
    }

    public UrlConfigElement()
    {
    }

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

    [ConfigurationProperty("url", DefaultValue = "http://www.contoso.com",
        IsRequired = true)]
    [RegexStringValidator(@"\w+:\/\/[\w.]+\S*")]
    public string Url
    {
        get
        {
            return (string)this["url"];
        }
        set
        {
            this["url"] = value;
        }
    }
    
    [ConfigurationProperty("port", DefaultValue = (int)4040, IsRequired = false)]
    [IntegerValidator(MinValue = 0, MaxValue = 8080, ExcludeRange = false)]
    public int Port
    {
        get
        {
            return (int)this["port"];
        }
        set
        {
            this["port"] = value;
        }
    }
}

Bu ikinci kod örneği daha önce belirtilen sınıfları kullanır. Bu iki örneği bir konsol uygulaması projesinde birleştirirsiniz.

using System;
using System.Configuration;
using System.Text;

class UsingConfigurationCollectionElement
{

    // Create a custom section and save it in the 
    // application configuration file.
    static void CreateCustomSection()
    {
        try
        {

            // Get the current configuration file.
            System.Configuration.Configuration config =
                    ConfigurationManager.OpenExeConfiguration(
                    ConfigurationUserLevel.None);

            // Add the custom section to the application
            // configuration file.
            UrlsSection myUrlsSection = (UrlsSection)config.Sections["MyUrls"];

            if (myUrlsSection == null)
            {
                //  The configuration file does not contain the
                // custom section yet. Create it.
                myUrlsSection = new UrlsSection();

                config.Sections.Add("MyUrls", myUrlsSection);

                // Save the application configuration file.
                myUrlsSection.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Modified); 
            }
            else
                if (myUrlsSection.Urls.Count == 0)
                {

                    // The configuration file contains the
                    // custom section but its element collection is empty.
                    // Initialize the collection. 
                    UrlConfigElement url = new UrlConfigElement();
                    myUrlsSection.Urls.Add(url);

                    // Save the application configuration file.
                    myUrlsSection.SectionInformation.ForceSave = true;
                    config.Save(ConfigurationSaveMode.Modified);
                }

            Console.WriteLine("Created custom section in the application configuration file: {0}",
                config.FilePath);
            Console.WriteLine();
        }
        catch (ConfigurationErrorsException err)
        {
            Console.WriteLine("CreateCustomSection: {0}", err.ToString());
        }
    }

    static void ReadCustomSection()
    {
        try
        {
            // Get the application configuration file.
            System.Configuration.Configuration config =
                    ConfigurationManager.OpenExeConfiguration(
                    ConfigurationUserLevel.None) as Configuration;

            // Read and display the custom section.
            UrlsSection myUrlsSection =
               config.GetSection("MyUrls") as UrlsSection;

            if (myUrlsSection == null)
            {
                Console.WriteLine("Failed to load UrlsSection.");
            }
            else
            {
                Console.WriteLine("Collection elements contained in the custom section collection:");
                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);
                }
            }
        }
        catch (ConfigurationErrorsException err)
        {
            Console.WriteLine("ReadCustomSection(string): {0}", err.ToString());
        }
    }

    // Add an element to the custom section collection.
    // This function uses the ConfigurationCollectionElement Add method.
    static void AddCollectionElement()
    {
        try
        {

            // Get the current configuration file.
            System.Configuration.Configuration config =
                    ConfigurationManager.OpenExeConfiguration(
                    ConfigurationUserLevel.None);

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

            // Add the element to the collection in the custom section.
            if (config.Sections["MyUrls"] != null)
            {
                UrlConfigElement urlElement = new UrlConfigElement();
                urlElement.Name = "Microsoft";
                urlElement.Url = "http://www.microsoft.com";
                urlElement.Port = 8080;
                
                // Use the ConfigurationCollectionElement Add method
                // to add the new element to the collection.
                myUrlsSection.Urls.Add(urlElement);

                // Save the application configuration file.
                myUrlsSection.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Modified);

                Console.WriteLine("Added collection element to the custom section in the configuration file: {0}",
                    config.FilePath);
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine("You must create the custom section first.");
            }
        }
        catch (ConfigurationErrorsException err)
        {
            Console.WriteLine("AddCollectionElement: {0}", err.ToString());
        }
    }

    // Remove element from the custom section collection.
    // This function uses one of the ConfigurationCollectionElement 
    // overloaded Remove methods.
    static void RemoveCollectionElement()
    {
        try
        {

            // Get the current configuration file.
            System.Configuration.Configuration config =
                    ConfigurationManager.OpenExeConfiguration(
                    ConfigurationUserLevel.None);

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

            // Remove the element from the custom section.
            if (config.Sections["MyUrls"] != null)
            {
                UrlConfigElement urlElement = new UrlConfigElement();
                urlElement.Name = "Microsoft";
                urlElement.Url = "http://www.microsoft.com";
                urlElement.Port = 8080;

                // Use one of the ConfigurationCollectionElement Remove 
                // overloaded methods to remove the element from the collection.
                myUrlsSection.Urls.Remove(urlElement);

                // Save the application configuration file.
                myUrlsSection.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Full);

                Console.WriteLine("Removed collection element from he custom section in the configuration file: {0}",
                    config.FilePath);
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine("You must create the custom section first.");
            }
        }
        catch (ConfigurationErrorsException err)
        {
            Console.WriteLine("RemoveCollectionElement: {0}", err.ToString());
        }
    }

    // Remove the collection of elements from the custom section.
    // This function uses the ConfigurationCollectionElement Clear method.
    static void ClearCollectionElements()
    {
        try
        {

            // Get the current configuration file.
            System.Configuration.Configuration config =
                    ConfigurationManager.OpenExeConfiguration(
                    ConfigurationUserLevel.None);

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

            // Remove the collection of elements from the section.
            if (config.Sections["MyUrls"] != null)
            {
                myUrlsSection.Urls.Clear();

                // Save the application configuration file.
                myUrlsSection.SectionInformation.ForceSave = true;
                config.Save(ConfigurationSaveMode.Full);

                Console.WriteLine("Removed collection of elements from he custom section in the configuration file: {0}",
                    config.FilePath);
                Console.WriteLine();
            }
            else
            {
                Console.WriteLine("You must create the custom section first.");
            }
        }
        catch (ConfigurationErrorsException err)
        {
            Console.WriteLine("ClearCollectionElements: {0}", err.ToString());
        }
    }

    public static void UserMenu()
    {
        string applicationName =
           Environment.GetCommandLineArgs()[0] + ".exe";
        StringBuilder buffer = new StringBuilder();

        buffer.AppendLine("Application: " + applicationName);
        buffer.AppendLine("Make your selection.");
        buffer.AppendLine("?    -- Display help.");
        buffer.AppendLine("Q,q  -- Exit the application.");
        buffer.Append("1    -- Create a custom section that");
        buffer.AppendLine(" contains a collection of elements.");
        buffer.Append("2    -- Read the custom section that");
        buffer.AppendLine(" contains a collection of custom elements.");
        buffer.Append("3    -- Add a collection element to");
        buffer.AppendLine(" the custom section.");
        buffer.Append("4    -- Remove a collection element from");
        buffer.AppendLine(" the custom section.");
        buffer.Append("5    -- Clear the collection of elements from");
        buffer.AppendLine(" the custom section.");
        
        Console.Write(buffer.ToString());
    }

    // Obtain user's input and provide
    // feedback.
    static void Main(string[] args)
    {
        // Define user selection string.
        string selection;

        // Get the name of the application.
        string appName =
          Environment.GetCommandLineArgs()[0];

        // Get user selection.
        while (true)
        {

            UserMenu();
            Console.Write("> ");
            selection = Console.ReadLine();
            if (!string.IsNullOrEmpty(selection))
                break;
        }

        while (selection.ToLower() != "q")
        {
            // Process user's input.
            switch (selection)
            {
                case "1":
                    // Create a custom section and save it in the 
                    // application configuration file.
                    CreateCustomSection();
                    break;

                case "2":
                    // Read the custom section from the
                    // application configuration file.
                    ReadCustomSection();
                    break;

                case "3":
                    // Add a collection element to the
                    // custom section.
                    AddCollectionElement();
                    break;

                case "4":
                    // Remove a collection element from the
                    // custom section.
                    RemoveCollectionElement();
                    break;

                case "5":
                    // Clear the collection of elements from the
                    // custom section.
                    ClearCollectionElements();
                    break;

                default:
                    UserMenu();
                    break;
            }
            Console.Write("> ");
            selection = Console.ReadLine();
        }
    }
}

Konsol uygulamasını çalıştırdığınızda, sınıfın UrlsSection bir örneği oluşturulur ve uygulama yapılandırma dosyasında aşağıdaki yapılandırma öğeleri oluşturulur:

<configuration>  
    <configSections>  
        <section name="MyUrls" type="UrlsSection,   
          ConfigurationElementCollection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />  
    </configSections>  
    <MyUrls>  
        <urls>  
           <add name="Contoso" url="http://www.contoso.com" port="4040" />  
        </urls>  
    </MyUrls>  
</configuration  

Açıklamalar

, ConfigurationElementCollection yapılandırma dosyasındaki bir öğe koleksiyonunu temsil eder.

Not

Yapılandırma dosyasındaki bir öğe, temel bir XML öğesine veya bir bölüme başvurur. Basit öğe, varsa ilgili özniteliklere sahip bir XML etiketidir. Basit bir öğe bir bölüm oluşturur. Karmaşık bölümler bir veya daha fazla basit öğe, bir öğe koleksiyonu ve diğer bölümleri içerebilir.

nesnesini bir nesne koleksiyonuyla ConfigurationElement çalışmak için kullanırsınızConfigurationElementCollection. Özel öğe koleksiyonlarını ConfigurationElement öğesine ConfigurationSectioneklemek için bu sınıfı uygulayın.

Uygulayanlara Notlar

Özel bir yapılandırma öğesi oluşturmak için program aracılığıyla veya bildirim temelli (öznitelikli) bir kodlama modeli kullanabilirsiniz.

Programlı model, her öğe özniteliği için değerini almak ve ayarlamak için bir özellik oluşturmanızı ve bunu temel alınan ConfigurationElement temel sınıfın iç özellik paketine eklemenizi gerektirir.

Öznitelikli model olarak da adlandırılan bildirim temelli model, bir özellik kullanarak ve özniteliklerle yapılandırarak bir öğe özniteliği tanımlamanıza olanak tanır. Bu öznitelikler, ASP.NET yapılandırma sistemine özellik türleri ve varsayılan değerleri hakkında bilgi verir. ASP.NET yansımayı kullanarak bu bilgileri alabilir ve ardından öğe özelliği nesnelerini oluşturabilir ve gerekli başlatmayı gerçekleştirebilir.

Oluşturucular

ConfigurationElementCollection()

ConfigurationElementCollection sınıfının yeni bir örneğini başlatır.

ConfigurationElementCollection(IComparer)

ConfigurationElementCollection sınıfının yeni bir örneğini oluşturur.

Özellikler

AddElementName

Türetilmiş bir sınıfta geçersiz kılındığında içindeki ConfigurationElementCollection ekleme işlemiyle ilişkilendirilecek öğesinin adını ConfigurationElement alır veya ayarlar.

ClearElementName

türetilmiş bir sınıfta geçersiz kılındığında içindeki clear işlemiyle ilişkilendirilecek öğesinin ConfigurationElementCollection adını ConfigurationElement alır veya ayarlar.

CollectionType

türünü ConfigurationElementCollectionalır.

Count

Koleksiyondaki öğe sayısını alır.

CurrentConfiguration

Geçerli ConfigurationElement örneğin ait olduğu yapılandırma hiyerarşisini temsil eden en üst düzey Configuration örneğe başvuru alır.

(Devralındığı yer: ConfigurationElement)
ElementInformation

Nesnenin özelleştirilebilir olmayan bilgilerini ve işlevselliğini ConfigurationElement içeren bir ElementInformation nesnesi alır.

(Devralındığı yer: ConfigurationElement)
ElementName

Türetilmiş bir sınıfta geçersiz kılındığında yapılandırma dosyasındaki bu öğe koleksiyonunu tanımlamak için kullanılan adı alır.

ElementProperty

Nesnenin ConfigurationElementProperty kendisini temsil ConfigurationElement eden nesneyi alır.

(Devralındığı yer: ConfigurationElement)
EmitClear

Koleksiyonun temizlenip temizlenmediğini belirten bir değer alır veya ayarlar.

EvaluationContext

Nesnenin ContextInformation nesnesini ConfigurationElement alır.

(Devralındığı yer: ConfigurationElement)
HasContext

özelliğinin nullolup olmadığını CurrentConfiguration gösteren bir değer alır.

(Devralındığı yer: ConfigurationElement)
IsSynchronized

Koleksiyona erişimin eşitlenip eşitlenmediğini belirten bir değer alır.

Item[ConfigurationProperty]

Bu yapılandırma öğesinin özelliğini veya özniteliğini alır veya ayarlar.

(Devralındığı yer: ConfigurationElement)
Item[String]

Bu yapılandırma öğesinin bir özelliğini, özniteliğini veya alt öğesini alır veya ayarlar.

(Devralındığı yer: ConfigurationElement)
LockAllAttributesExcept

Kilitli özniteliklerin koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockAllElementsExcept

Kilitli öğeler koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockAttributes

Kilitli özniteliklerin koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockElements

Kilitli öğeler koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
LockItem

Öğesinin kilitli olup olmadığını belirten bir değer alır veya ayarlar.

(Devralındığı yer: ConfigurationElement)
Properties

Özellik koleksiyonunu alır.

(Devralındığı yer: ConfigurationElement)
RemoveElementName

Türetilmiş bir sınıfta geçersiz kılındığında içindeki ConfigurationElementCollection kaldırma işlemiyle ilişkilendirilecek öğesinin adını ConfigurationElement alır veya ayarlar.

SyncRoot

öğesine erişimi ConfigurationElementCollectioneşitlemek için kullanılan bir nesneyi alır.

ThrowOnDuplicate

öğesine yineleme ConfigurationElement ekleme girişiminin ConfigurationElementCollection özel durum oluşturulup oluşturulmayacağını belirten bir değer alır.

Yöntemler

BaseAdd(ConfigurationElement)

öğesine ConfigurationElementCollectionbir yapılandırma öğesi ekler.

BaseAdd(ConfigurationElement, Boolean)

Yapılandırma öğesi koleksiyonuna bir yapılandırma öğesi ekler.

BaseAdd(Int32, ConfigurationElement)

Yapılandırma öğesi koleksiyonuna bir yapılandırma öğesi ekler.

BaseClear()

Koleksiyondaki tüm yapılandırma öğesi nesnelerini kaldırır.

BaseGet(Int32)

Belirtilen dizin konumundaki yapılandırma öğesini alır.

BaseGet(Object)

Belirtilen anahtarla yapılandırma öğesini döndürür.

BaseGetAllKeys()

içinde bulunan tüm yapılandırma öğeleri için anahtarların bir dizisini ConfigurationElementCollectiondöndürür.

BaseGetKey(Int32)

Belirtilen dizin konumunda anahtarını ConfigurationElement alır.

BaseIndexOf(ConfigurationElement)

Belirtilen ConfigurationElementöğesinin dizinini gösterir.

BaseIsRemoved(Object)

Belirtilen anahtara sahip öğesinin öğesinden ConfigurationElementCollectionkaldırılıp kaldırılmadığını ConfigurationElement gösterir.

BaseRemove(Object)

ConfigurationElement Bir öğesini koleksiyondan kaldırır.

BaseRemoveAt(Int32)

ConfigurationElement Belirtilen dizin konumunda öğesini kaldırır.

CopyTo(ConfigurationElement[], Int32)

öğesinin ConfigurationElementCollection içeriğini bir diziye kopyalar.

CreateNewElement()

Türetilmiş bir sınıfta geçersiz kılındığında yeni ConfigurationElementbir oluşturur.

CreateNewElement(String)

Türetilmiş bir sınıfta geçersiz kılındığında yeni ConfigurationElement bir oluşturur.

DeserializeElement(XmlReader, Boolean)

Yapılandırma dosyasından XML okur.

(Devralındığı yer: ConfigurationElement)
Equals(Object)

öğesini ConfigurationElementCollection belirtilen nesneyle karşılaştırır.

GetElementKey(ConfigurationElement)

Türetilmiş bir sınıfta geçersiz kılındığında belirtilen yapılandırma öğesinin öğe anahtarını alır.

GetEnumerator()

aracılığıyla ConfigurationElementCollectionyinelemek için kullanılan bir IEnumerator alır.

GetHashCode()

Örneği temsil eden ConfigurationElementCollection benzersiz bir değer alır.

GetTransformedAssemblyString(String)

Belirtilen derleme adının dönüştürülmüş sürümünü döndürür.

(Devralındığı yer: ConfigurationElement)
GetTransformedTypeString(String)

Belirtilen tür adının dönüştürülmüş sürümünü döndürür.

(Devralındığı yer: ConfigurationElement)
GetType()

Type Geçerli örneğini alır.

(Devralındığı yer: Object)
Init()

ConfigurationElement Nesneyi ilk durumuna ayarlar.

(Devralındığı yer: ConfigurationElement)
InitializeDefault()

Nesne için varsayılan değer kümesini başlatmak için ConfigurationElement kullanılır.

(Devralındığı yer: ConfigurationElement)
IsElementName(String)

Belirtilen ConfigurationElement öğesinin içinde ConfigurationElementCollectionmevcut olup olmadığını gösterir.

IsElementRemovable(ConfigurationElement)

Belirtilen ConfigurationElement öğesinin öğesinden ConfigurationElementCollectionkaldırılıp kaldırılamayacağını gösterir.

IsModified()

Bunun ConfigurationElementCollection , türetilmiş bir sınıfta son kaydedildiğinden veya geçersiz kılındığında yüklendiğinden beri değiştirilip değiştirilmediğini gösterir.

IsReadOnly()

Nesnenin ConfigurationElementCollection salt okunur olup olmadığını gösterir.

ListErrors(IList)

Bu ConfigurationElement nesnedeki ve tüm alt öğelerdeki invalid-property hatalarını geçirilen listeye ekler.

(Devralındığı yer: ConfigurationElement)
MemberwiseClone()

Geçerli Objectöğesinin sığ bir kopyasını oluşturur.

(Devralındığı yer: Object)
OnDeserializeUnrecognizedAttribute(String, String)

Seri durumdan çıkarma sırasında bilinmeyen bir öznitelikle karşılaşılıp karşılaşılmadığını belirten bir değer alır.

(Devralındığı yer: ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

Yapılandırma sisteminin özel durum oluşturmasına neden olur.

OnRequiredPropertyNotFound(String)

Gerekli bir özellik bulunamadığında bir özel durum oluşturur.

(Devralındığı yer: ConfigurationElement)
PostDeserialize()

Seri durumdan çıkarıldıktan sonra çağrılır.

(Devralındığı yer: ConfigurationElement)
PreSerialize(XmlWriter)

Serileştirmeden önce çağrılır.

(Devralındığı yer: ConfigurationElement)
Reset(ConfigurationElement)

türetilmiş bir sınıfta geçersiz kılındığında öğesini değiştirilmemiş durumuna sıfırlar ConfigurationElementCollection .

ResetModified()

Türetilmiş bir sınıfta geçersiz kılındığında özelliğinin IsModified()false değerini olarak sıfırlar.

SerializeElement(XmlWriter, Boolean)

Türetilmiş bir sınıfta geçersiz kılındığında yapılandırma verilerini yapılandırma dosyasındaki bir XML öğesine yazar.

SerializeToXmlElement(XmlWriter, String)

Türetilmiş bir sınıfta uygulandığında bu yapılandırma öğesinin dış etiketlerini yapılandırma dosyasına yazar.

(Devralındığı yer: ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

Bir özelliği belirtilen değere ayarlar.

(Devralındığı yer: ConfigurationElement)
SetReadOnly()

nesnesinin IsReadOnly() ve tüm alt öğelerinin ConfigurationElementCollection özelliğini ayarlar.

ToString()

Geçerli nesneyi temsil eden dizeyi döndürür.

(Devralındığı yer: Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

Yapılandırma bilgilerini yapılandırma hiyerarşisinin farklı düzeylerinden birleştirmenin etkisini tersine çevirir.

Belirtik Arabirim Kullanımları

Uzantı Metotları

Cast<TResult>(IEnumerable)

öğesinin IEnumerable öğelerini belirtilen türe atar.

OfType<TResult>(IEnumerable)

Öğesinin IEnumerable öğelerini belirtilen türe göre filtreler.

AsParallel(IEnumerable)

Sorgunun paralelleştirilmesini etkinleştirir.

AsQueryable(IEnumerable)

bir IEnumerable öğesini öğesine IQueryabledönüştürür.

Şunlara uygulanır

Ürün Sürümler
.NET 6, 7, 8, 9
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Ayrıca bkz.