다음을 통해 공유


EditPoint.ReadOnly 메서드

지정한 범위의 텍스트가 읽기 전용인지 여부를 나타내는 값을 반환합니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
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

매개 변수

  • PointOrCount
    형식: Object

    필수 요소. TextPoint 개체 또는 여러 문자입니다.

반환 값

형식: Boolean
선택 영역에 읽기 전용 텍스트가 들어 있으면 true이고, 그렇지 않으면 false입니다.

설명

문서 전체가 읽기 전용으로 표시되어 있거나 문자가 읽기 전용 블록에 있으면 해당 문자는 읽기 전용일 수 있습니다.

예제

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 보안

참고 항목

참조

EditPoint 인터페이스

EnvDTE 네임스페이스