다음을 통해 공유


CollectionBase.Clear 메서드

CollectionBase 인스턴스에서 개체를 모두 제거합니다. 이 메서드는 재정의할 수 없습니다.

네임스페이스: System.Collections
어셈블리: mscorlib(mscorlib.dll)

구문

‘선언
Public Sub Clear
‘사용 방법
Dim instance As CollectionBase

instance.Clear
public void Clear ()
public:
virtual void Clear () sealed
public final void Clear ()
public final function Clear ()

설명

Count는 0으로 설정되어 있습니다.

이 메서드는 O(n) 연산이며, 여기서 n은 Count입니다.

컬렉션을 지우기 전이나 후에 사용자 지정 작업을 수행하려면 보호된 OnClear 또는 OnClearComplete 메서드를 재정의합니다.

플랫폼

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에서 지원

참고 항목

참조

CollectionBase 클래스
CollectionBase 멤버
System.Collections 네임스페이스