Replace Method (offset, length, text, offsetChangeMap)
NamespacesICSharpCode.AvalonEdit.DocumentTextDocumentReplace(Int32, Int32, ITextSource, OffsetChangeMap)
Replaces text.
Declaration Syntax
C#Visual BasicVisual C++
public void Replace(
	int offset,
	int length,
	ITextSource text,
	OffsetChangeMap offsetChangeMap
Public Sub Replace ( _
	offset As Integer, _
	length As Integer, _
	text As ITextSource, _
	offsetChangeMap As OffsetChangeMap _
void Replace(
	int offset, 
	int length, 
	ITextSource^ text, 
	OffsetChangeMap^ offsetChangeMap
offset (Int32)
The starting offset of the text to be replaced.
length (Int32)
The length of the text to be replaced.
text (ITextSource)
The new text.
offsetChangeMap (OffsetChangeMap)
The offsetChangeMap determines how offsets inside the old text are mapped to the new text. This affects how the anchors and segments inside the replaced region behave. If you pass null (the default when using one of the other overloads), the offsets are changed as in OffsetChangeMappingType.Normal mode. If you pass OffsetChangeMap.Empty, then everything will stay in its old place (OffsetChangeMappingType.CharacterReplace mode). The offsetChangeMap must be a valid 'explanation' for the document change. See IsValidForDocumentChange(Int32, Int32, Int32). Passing an OffsetChangeMap to the Replace method will automatically freeze it to ensure the thread safety of the resulting DocumentChangeEventArgs instance.

Assembly: ICSharpCode.AvalonEdit (Module: ICSharpCode.AvalonEdit.dll) Version: