다음을 통해 공유


VCCodeBase.IsReadOnly 속성

부모 개체가 들어 있는 파일이 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

네임스페이스:  Microsoft.VisualStudio.VCCodeModel
어셈블리:  Microsoft.VisualStudio.VCCodeModel(Microsoft.VisualStudio.VCCodeModel.dll)

구문

‘선언
ReadOnly Property IsReadOnly As Boolean
bool IsReadOnly { get; }
property bool IsReadOnly {
    bool get ();
}
abstract IsReadOnly : bool with get
function get IsReadOnly () : boolean

속성 값

형식: System.Boolean
파일이 읽기 전용이면 true이고, 그렇지 않으면 false입니다.

설명

이 샘플을 컴파일하고 실행하는 방법을 보려면 방법: Visual C++ 코드 모델 확장성에 대한 예제 코드 컴파일을 참조하십시오.

예제

코드 요소에 메모를 추가 하기 전에 읽기 전용 파일인 경우 확인 하는이 예제입니다.

Sub AddComment()
    Dim vcElement As VCCodeElement
    Dim vcElements As VCCodeElements
    Dim textPoint As TextPoint
    vcElements = DTE.Solution.Item(1).CodeModel.Classes
    vcElement = vcElements.Item(1)
    If (Not vcElement.IsReadOnly) Then
        vcElement.Comment = "This is a comment."
    End If
End Sub

.NET Framework 보안

  • 직접 실행 호출자의 경우 완전히 신뢰합니다. 이 멤버는 부분적으로 신뢰할 수 있는 코드에서 사용할 수 없습니다. 자세한 내용은 부분 신뢰 코드에서 라이브러리 사용을 참조하십시오.

참고 항목

참조

VCCodeBase 인터페이스

Microsoft.VisualStudio.VCCodeModel 네임스페이스