Aracılığıyla paylaş


VCCodeVariable.IsReadOnly Özellik

Nesneyi içeren dosyanın salt okunur olup olmadığını belirler.

Ad alanı:  Microsoft.VisualStudio.VCCodeModel
Derleme:  Microsoft.VisualStudio.VCCodeModel (Microsoft.VisualStudio.VCCodeModel.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property IsReadOnly As Boolean
bool IsReadOnly { get; }
property bool IsReadOnly {
    bool get ();
}
abstract IsReadOnly : bool with get
function get IsReadOnly () : boolean

Özellik Değeri

Tür: Boolean
true Geçerli öğe salt okunur Aksi halde, false.

Notlar

Bkz: Nasıl yapılır: Visual C++ Kod Modeli Genişletilebilirliği için Örnek Kod Derleme derlemek ve bu örnek çalıştırma hakkında bilgi için.

Örnekler

Bu örnekte, dosya kod öğesi için bir yorum eklemeden önce salt okunur olup olmadığını doğrular.

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 Güvenliği

Ayrıca bkz.

Başvuru

VCCodeVariable Arabirim

Microsoft.VisualStudio.VCCodeModel Ad Alanı