다음을 통해 공유


PropertyDescriptor.CanResetValue 메서드

파생 클래스에서 재정의된 경우 개체를 다시 설정하면 해당 값이 변경되는지 여부를 반환합니다.

네임스페이스: System.ComponentModel
어셈블리: System(system.dll)

구문

‘선언
Public MustOverride Function CanResetValue ( _
    component As Object _
) As Boolean
‘사용 방법
Dim instance As PropertyDescriptor
Dim component As Object
Dim returnValue As Boolean

returnValue = instance.CanResetValue(component)
public abstract bool CanResetValue (
    Object component
)
public:
virtual bool CanResetValue (
    Object^ component
) abstract
public abstract boolean CanResetValue (
    Object component
)
public abstract function CanResetValue (
    component : Object
) : boolean

매개 변수

  • component
    다시 설정 기능을 테스트할 구성 요소입니다.

반환 값

구성 요소를 다시 설정하면 해당 값이 변경되는 경우 true이고, 그렇지 않으면 false입니다.

설명

일반적으로 이 메서드는 리플렉션을 통해 구현됩니다.

상속자 참고 사항 이 메서드가 파생 클래스에서 재정의된 경우 DefaultValueAttribute를 찾고, 특성이 발견되면 해당 특성 값을 속성의 현재 값과 비교합니다. 기본값이 해당 속성의 현재 값과 일치하지 않는 경우에는 true를 반환합니다. 이 메서드가 DefaultValueAttribute를 찾을 수 없는 경우에는 자체 구현에 필요한 "ShouldPersistMyProperty" 메서드를 찾습니다. 이 메서드를 찾으면 CanResetValue는 "ShouldPersistMyProperty"가 반환하는 것을 반환합니다. 또는 자체 구현에 필요한 "ResetMyProperty" 메서드를 찾습니다. 이 메서드를 찾으면 CanResetValuetrue를 반환합니다. DefaultValueAttribute인 "ShouldPersistMyProperty" 메서드나 "ResetMyProperty" 메서드를 찾을 수 없는 경우에는 false가 반환됩니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

PropertyDescriptor 클래스
PropertyDescriptor 멤버
System.ComponentModel 네임스페이스
PropertyDescriptor 클래스