VCCodeStruct.IsReadOnly Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets if the file containing the object is read-only.
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
Property Value
true if the file containing the object is read-only; otherwise, false.
- Attributes
Examples
This example verifies if the file is read-only before adding a comment to the code element.
[Visual Basic]
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