ConfigurationLocationCollection 클래스

정의

ConfigurationLocationCollection 개체의 컬렉션을 포함합니다.

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

예제

다음 코드 예제에서는 애플리케이션에 대 한 웹 구성에서에서 MySampleApp 는 로드, 반복 하 여이 구성에 정의 된 위치가 표시 됩니다는 ConfigurationLocationCollection 에서 반환 된 개체는 Locations 속성입니다.

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

설명

클래스를 ConfigurationLocationCollection 사용하여 위치별 구성 설정이 정의된 리소스를 나타내는 개체 컬렉션을 ConfigurationLocation 반복합니다. ConfigurationLocationCollection 는 속성에서 반환되는 형식입니다 Locations .

참고

클래스는 ConfigurationLocationCollection 구성 파일에 지정된 순서대로 개체의 ConfigurationLocation 컬렉션을 참조하지 않을 수 있습니다.

속성

Count

ReadOnlyCollectionBase 인스턴스에 포함된 요소 수를 가져옵니다.

(다음에서 상속됨 ReadOnlyCollectionBase)
InnerList

ReadOnlyCollectionBase 인스턴스에 포함된 요소의 목록을 가져옵니다.

(다음에서 상속됨 ReadOnlyCollectionBase)
Item[Int32]

지정된 인덱스의 ConfigurationLocationCollection 개체를 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

ReadOnlyCollectionBase 인스턴스를 반복하는 열거자를 반환합니다.

(다음에서 상속됨 ReadOnlyCollectionBase)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

ICollection.CopyTo(Array, Int32)

대상 배열의 지정된 인덱스에서 시작하여 전체 ReadOnlyCollectionBase을 호환되는 1차원 Array에 복사합니다.

(다음에서 상속됨 ReadOnlyCollectionBase)
ICollection.IsSynchronized

ReadOnlyCollectionBase 개체에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ReadOnlyCollectionBase)
ICollection.SyncRoot

ReadOnlyCollectionBase 개체에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

(다음에서 상속됨 ReadOnlyCollectionBase)

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상