ConfigurationLocationCollection Klas

Definitie

Bevat een verzameling ConfigurationLocationCollection objecten.

public ref class ConfigurationLocationCollection : System::Collections::ReadOnlyCollectionBase
public class ConfigurationLocationCollection : System.Collections.ReadOnlyCollectionBase
type ConfigurationLocationCollection = class
    inherit ReadOnlyCollectionBase
Public Class ConfigurationLocationCollection
Inherits ReadOnlyCollectionBase
Overname
ConfigurationLocationCollection

Voorbeelden

In het volgende codevoorbeeld wordt de webconfiguratie voor de toepassing MySampleApp geladen en worden de locaties die in deze configuratie zijn gedefinieerd, weergegeven door het ConfigurationLocationCollection object te doorlopen dat door de Locations eigenschap wordt geretourneerd.

using System;
using System.Collections;
using System.Configuration;

class DisplayLocationInfo
{
    static void Main(string[] args)
    {
        Configuration config = 
            ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
        ConfigurationLocationCollection myLocationCollection = config.Locations;
        foreach (ConfigurationLocation myLocation in myLocationCollection)
        {
            Console.WriteLine("Location Path: {0}", myLocation.Path);
            Configuration myLocationConfiguration = myLocation.OpenConfiguration();
            Console.WriteLine("Location Configuration File Path: {0}",
                myLocationConfiguration.FilePath);
        }
        Console.WriteLine("Done...");
        Console.ReadLine();
    }
}
Imports System.Collections
Imports System.Configuration

Class DisplayLocationInfo
    Public Overloads Shared Sub Main()
        Dim config As System.Configuration.Configuration = _
            ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
        Dim myLocationCollection As _
            System.Configuration.ConfigurationLocationCollection = config.Locations
        Dim myLocation As ConfigurationLocation
        For Each myLocation In  myLocationCollection
            Console.WriteLine("Location Path: {0}", myLocation.Path)
            Dim myLocationConfiguration As System.Configuration.Configuration = _
                myLocation.OpenConfiguration()
            Console.WriteLine("Location Configuration Path: {0}", _
                myLocationConfiguration.FilePath)
        Next myLocation
        Console.WriteLine("Done...")
        Console.ReadLine()
    End Sub
End Class

Opmerkingen

Gebruik de ConfigurationLocationCollection klasse om een verzameling ConfigurationLocation objecten te doorlopen, die de resources vertegenwoordigen waarvoor locatiespecifieke configuratie-instellingen zijn gedefinieerd. ConfigurationLocationCollection is het type dat door de Locations eigenschap wordt geretourneerd.

Note

De ConfigurationLocationCollection klasse verwijst mogelijk niet naar de verzameling ConfigurationLocation objecten in de volgorde waarin ze zijn opgegeven in het configuratiebestand.

Eigenschappen

Name Description
Count

Hiermee haalt u het aantal elementen op dat in het ReadOnlyCollectionBase exemplaar is opgenomen.

(Overgenomen van ReadOnlyCollectionBase)
InnerList

Hiermee haalt u de lijst met elementen op die zijn opgenomen in het ReadOnlyCollectionBase exemplaar.

(Overgenomen van ReadOnlyCollectionBase)
Item[Int32]

Hiermee haalt u het ConfigurationLocationCollection object op bij de opgegeven index.

Methoden

Name Description
Equals(Object)

Bepaalt of het opgegeven object gelijk is aan het huidige object.

(Overgenomen van Object)
GetEnumerator()

Retourneert een enumerator die door het ReadOnlyCollectionBase exemplaar wordt herhaald.

(Overgenomen van ReadOnlyCollectionBase)
GetHashCode()

Fungeert als de standaardhashfunctie.

(Overgenomen van Object)
GetType()

Hiermee haalt u de Type huidige instantie op.

(Overgenomen van Object)
MemberwiseClone()

Hiermee maakt u een ondiepe kopie van de huidige Object.

(Overgenomen van Object)
ToString()

Retourneert een tekenreeks die het huidige object vertegenwoordigt.

(Overgenomen van Object)

Expliciete interface-implementaties

Name Description
ICollection.CopyTo(Array, Int32)

Kopieert het hele ReadOnlyCollectionBase naar een compatibele eendimensionale Arraywaarde, beginnend bij de opgegeven index van de doelmatrix.

(Overgenomen van ReadOnlyCollectionBase)
ICollection.IsSynchronized

Hiermee wordt een waarde opgehaald die aangeeft of de toegang tot een ReadOnlyCollectionBase object wordt gesynchroniseerd (thread safe).

(Overgenomen van ReadOnlyCollectionBase)
ICollection.SyncRoot

Hiermee haalt u een object op dat kan worden gebruikt om de toegang tot een ReadOnlyCollectionBase object te synchroniseren.

(Overgenomen van ReadOnlyCollectionBase)

Extensiemethoden

Name Description
AsParallel(IEnumerable)

Hiermee schakelt u parallelle uitvoering van een query in.

AsQueryable(IEnumerable)

Converteert een IEnumerable naar een IQueryable.

Cast<TResult>(IEnumerable)

Cast de elementen van een IEnumerable naar het opgegeven type.

OfType<TResult>(IEnumerable)

Hiermee filtert u de elementen van een IEnumerable op basis van een opgegeven type.

Van toepassing op