ElementInformation 클래스

정의

구성의 개별 요소에 대한 메타 정보를 포함합니다. 이 클래스는 상속될 수 없습니다.

public ref class ElementInformation sealed
public sealed class ElementInformation
type ElementInformation = class
Public NotInheritable Class ElementInformation
상속
ElementInformation

예제

다음 예제에서는 가져오는 방법을 ElementInformation 보여 주는 개체와 ConfigurationElement 연결 합니다.

static public ElementInformation
    GetElementInformation()
{

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

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

    // Get the element.
    UrlConfigElement url = section.Simple;

    ElementInformation eInfo =
        url.ElementInformation;

    return eInfo;
}
Public Shared Function GetElementInformation() _
As ElementInformation

    ' Get the current configuration file.
    Dim config _
    As System.Configuration.Configuration = _
    ConfigurationManager.OpenExeConfiguration( _
    ConfigurationUserLevel.None)

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

    ' Get the element.
    Dim url As UrlConfigElement = _
    section.Simple

    Dim eInfo As ElementInformation = _
    url.ElementInformation

    Return eInfo

End Function 'GetElementInformation

다음 발췌문에서는 이전 코드 예제에서 사용한 구성을 보여 있습니다.

<?xml version="1.0" encoding="utf-8"?>  
<configuration>  
  <configSections>  
    <section name="MyUrls" type="Samples.AspNet.UrlsSection,  
      ConfigurationElement, Version=1.0.0.0, Culture=neutral,  
      PublicKeyToken=null" allowDefinition="Everywhere"  
      allowExeDefinition="MachineToApplication"  
      restartOnExternalChanges="true" />  
  </configSections>  
  <MyUrls name="MyFavorites">  
    <simple name="Contoso" url="http://www.contoso.com" port="8080" />  
    <urls>  
      <clear />  
      <add name="Microsoft" url="http://www.microsoft.com" port="0" />  
    </urls>  
  </MyUrls>  
</configuration>  

설명

개체에는 ElementInformation 구성 내의 개별 요소에 대한 메타 정보가 포함됩니다. 이 개체는 개별 요소의 속성의 유효성을 검사하고 변경할 때 사용할 수 있습니다.

속성

Errors

연결된 요소와 하위 요소에 대한 오류를 가져옵니다.

IsCollection

연결된 ConfigurationElement 개체가 ConfigurationElementCollection 컬렉션인지 여부를 나타내는 값을 가져옵니다.

IsLocked

연결된 ConfigurationElement 개체를 수정할 수 없는지 여부를 나타내는 값을 가져옵니다.

IsPresent

연결된 ConfigurationElement 개체가 구성 파일에 있는지 여부를 나타내는 값을 가져옵니다.

LineNumber

연결된 ConfigurationElement 개체가 정의되어 있는 구성 파일의 줄 번호를 가져옵니다.

Properties

연결된 PropertyInformationCollection 개체에 있는 속성의 ConfigurationElement 컬렉션을 가져옵니다.

Source

연결된 ConfigurationElement 개체를 처음으로 제공한 소스 파일을 가져옵니다.

Type

관련된 ConfigurationElement 개체의 형식을 가져옵니다.

Validator

연결된 ConfigurationElement 개체의 유효성을 검사하는 데 사용되는 개체를 가져옵니다.

메서드

Equals(Object)

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

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

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상

추가 정보