VCCodeMapEntry.IsReadOnly Eigenschaft

Definition

Ruft einen Wert ab, der angibt, ob die Datei, die das Objekt enthält, schreibgeschützt ist.

public:
 property bool IsReadOnly { bool get(); };
public:
 property bool IsReadOnly { bool get(); };
[System.Runtime.InteropServices.DispId(514)]
public bool IsReadOnly { [System.Runtime.InteropServices.DispId(514)] [System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)] get; }
[<System.Runtime.InteropServices.DispId(514)>]
[<get: System.Runtime.InteropServices.DispId(514)>]
[<get: System.Runtime.InteropServices.TypeLibFunc(System.Runtime.InteropServices.TypeLibFuncFlags.FNonBrowsable)>]
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean

Eigenschaftswert

Boolean

true , wenn die Datei, die das Objekt enthält, schreibgeschützt ist. andernfalls false .

Attribute

Beispiele

In diesem Beispiel wird überprüft, ob die Datei schreibgeschützt ist, bevor dem Code Element ein Kommentar hinzugefügt wird.

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  

Hinweise

Weitere Informationen zum Kompilieren und Ausführen dieses Beispiels finden Sie unter Gewusst wie: Kompilieren von Beispielcode für die Erweiterbarkeit von Visual C++-Code Modellen .

Gilt für