TextSelection.MoveToLineAndOffset Yöntem
Etkin noktayı verilen konuma taşır.
Ad alanı: EnvDTE
Derleme: EnvDTE (EnvDTE.dll içinde)
Sözdizimi
'Bildirim
Sub MoveToLineAndOffset ( _
Line As Integer, _
Offset As Integer, _
Extend As Boolean _
)
void MoveToLineAndOffset(
int Line,
int Offset,
bool Extend
)
void MoveToLineAndOffset(
[InAttribute] int Line,
[InAttribute] int Offset,
[InAttribute] bool Extend
)
abstract MoveToLineAndOffset :
Line:int *
Offset:int *
Extend:bool -> unit
function MoveToLineAndOffset(
Line : int,
Offset : int,
Extend : boolean
)
Parametreler
- Line
Tür: System.Int32
Gerekli.Satır numarası, taşımak için tek tek başlayarak.LineAyrıca sabitlerinden biri olabilir vsGoToLineOptions.
- Offset
Tür: System.Int32
Gerekli.Tek tek başlayarak satırdaki karakter dizin konumu.
- Extend
Tür: System.Boolean
İsteğe Bağlı.Default = false.Geçerli seçimi genişletmek için bir Boole değeri.Extend Olan true, sonra da etkin seçimin sonuna çapa son kalır olduğu sırada bir konuma taşır.Aksi takdirde, her iki ucu belirtilen konuma taşınır.Bu bağımsız değişken yalnızca için geçerlidir TextSelection nesne.
Notlar
Varsa değeri Offset son satırının belge satırın sonuna taşır karakterdir.
Örnekler
Sub MoveToLineAndOffsetExample()
' Before running this example, open a text document.
Dim objSel As TextSelection = DTE.ActiveDocument.Selection
' Move to the beginning of the document so we can iterate over the
' whole thing.
objSel.StartOfDocument()
While objSel.FindPattern("#if _DEBUG")
' If we found the beginning of a debug-only section, save the
' position.
Dim lStartLine As Long = objSel.TopPoint.Line
Dim lStartColumn As Long = objSel.TopPoint.LineCharOffset
' Look for the end.
If objSel.FindPattern("#endif") Then
' Select the entire section and outline it.
objSel.SwapAnchor()
objSel.MoveToLineAndOffset(lStartLine, lStartColumn, True)
objSel.OutlineSection()
objSel.LineDown()
End If
End While
End Sub
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen güvenilen kod kitaplıklarını kullanma.