Freigeben über


EditPoint.ReadOnly-Methode

Gibt einen Wert zurück, der angibt, ob Teile des angegebenen Textbereichs schreibgeschützten Text enthalten.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
Function ReadOnly ( _
    PointOrCount As Object _
) As Boolean
bool ReadOnly(
    Object PointOrCount
)
bool ReadOnly(
    [InAttribute] Object^ PointOrCount
)
abstract ReadOnly : 
        PointOrCount:Object -> bool
function ReadOnly(
    PointOrCount : Object
) : boolean

Parameter

  • PointOrCount
    Typ: Object

    Erforderlich. Entweder ein TextPoint-Objekt oder eine Anzahl von Zeichen.

Rückgabewert

Typ: Boolean
true, wenn die Auswahl schreibgeschützten Text enthält; andernfalls false.

Hinweise

Ein Zeichen kann schreibgeschützt sein, wenn das gesamte Dokument als schreibgeschützt markiert ist oder es sich in einem schreibgeschützten Block befindet.

Beispiele

Sub ReadOnlyExample()
   Dim objTextDoc As TextDocument
   Dim objMovePt As EditPoint
   Dim objEditPt As EditPoint, iCtr As Integer

   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")

   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
   objMovePt = objTextDoc.EndPoint.CreateEditPoint
        
   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objEditPt.Insert("This is a test." & Chr(13))
   Next iCtr
   ' Move the active point to where the second edit point is
   ' and then insert some text.
   MsgBox("Is text read-only? " & objEditPt.ReadOnly(5))
End Sub

.NET Framework-Sicherheit

Siehe auch

Referenz

EditPoint Schnittstelle

EnvDTE-Namespace