개인 보호 (Visual Basic)Private Protected (Visual Basic)
Private Protected
키워드 조합은 멤버 액세스 한정자입니다.The Private Protected
keyword combination is a member access modifier. 멤버는 포함 하는 Private Protected
클래스의 모든 멤버 뿐 아니라 포함 하는 클래스에서 파생 된 형식 뿐만 아니라 포함 하는 어셈블리에 있는 경우에만 액세스할 수 있습니다.A Private Protected
member is accessible by all members in its containing class, as well as by types derived from the containing class, but only if they are found in its containing assembly.
클래스의 멤버만 지정할 수 있습니다. 구조체 Private Protected
Private Protected
는 상속 될 수 없으므로 구조체의 멤버에는 적용할 수 없습니다.You can specify Private Protected
only on members of classes; you cannot apply Private Protected
to members of a structure because structures cannot be inherited.
Private Protected
액세스 한정자는 Visual Basic 15.5 이상에서 지원 됩니다.The Private Protected
access modifier is supported by Visual Basic 15.5 and later. 이를 사용 하려면 Visual Basic 프로젝트 (.vbproj) 파일에 다음 요소를 추가 하면 * 됩니다.To use it, you can add the following element to your Visual Basic project (*.vbproj) file. Visual Basic 15.5 이상이 시스템에 설치 되어 있으면 최신 버전의 Visual Basic 컴파일러에서 지 원하는 모든 언어 기능을 활용할 수 있습니다.As long as Visual Basic 15.5 or later is installed on your system, it lets you take advantage of all the language features supported by the latest version of the Visual Basic compiler:
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
자세한 내용은 Visual Basic 언어 버전 설정을 참조 하세요.For more information see setting the Visual Basic language version.
참고
Visual Studio에서 F1 도움말을 선택 하 여 private protected
개인 또는 보호 된에 대 한 도움말을 제공 합니다.In Visual Studio, selecting F1 help on private protected
provides help for either private or protected. IDE는 복합 단어가 아니라 커서에서 단일 토큰을 선택 합니다.The IDE picks the single token under the cursor rather than the compound word.
규칙Rules
- 선언 컨텍스트.Declaration Context.
Private Protected
는 클래스 수준 에서만 사용할 수 있습니다.You can usePrivate Protected
only at the class level. 즉, 요소에 대 한 선언 컨텍스트는Protected
클래스 여야 하며 소스 파일, 네임 스페이스, 인터페이스, 모듈, 구조체 또는 프로시저일 수 없습니다.This means the declaration context for aProtected
element must be a class, and cannot be a source file, namespace, interface, module, structure, or procedure.
동작Behavior
액세스 수준입니다.Access Level. 클래스의 모든 코드는 해당 요소에 액세스할 수 있습니다.All code in a class can access its elements. 기본 클래스에서 파생 되 고 동일한 어셈블리에 포함 된 모든 클래스의 코드는 기본 클래스의 모든 요소에 액세스할 수 있습니다
Private Protected
.Code in any class that derives from a base class and is contained in the same assembly can access all thePrivate Protected
elements of the base class. 그러나 기본 클래스에서 파생 되 고 다른 어셈블리에 포함 된 모든 클래스의 코드는 기본 클래스 요소에 액세스할 수 없습니다Private Protected
.However, code in any class that derives from a base class and is contained in a different assembly can't access the base classPrivate Protected
elements.액세스 한정자입니다.Access Modifiers. 액세스 수준을 지정 하는 키워드를 액세스 한정자라고 합니다.The keywords that specify access level are called access modifiers. 액세스 한정자의 비교는 Visual Basic의 액세스 수준을 참조 하세요.For a comparison of the access modifiers, see Access levels in Visual Basic.
Private Protected
한정자는 다음 컨텍스트에서 사용할 수 있습니다.The Private Protected
modifier can be used in these contexts:
중첩 된 클래스의 Class 문Class Statement of a nested class
클래스에 중첩 된 대리자의 Delegate 문Delegate Statement of a delegate nested in a class
클래스에 중첩 된 열거형의 Enum 문Enum Statement of an enumeration nested in a class
클래스에 중첩 된 인터페이스의 인터페이스 문Interface Statement of an interface nested in a class
클래스에 중첩 된 구조체의 구조체 문Structure Statement of a structure nested in a class