本文整理汇总了C#中Mono.TextEditor.DocumentChangeEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# DocumentChangeEventArgs类的具体用法?C# DocumentChangeEventArgs怎么用?C# DocumentChangeEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DocumentChangeEventArgs类属于Mono.TextEditor命名空间,在下文中一共展示了DocumentChangeEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TextReplaced
public void TextReplaced (object sender, DocumentChangeEventArgs args)
{
throw new NotSupportedException ("Operation not supported on this line splitter.");
}
示例2: HandleSkipCharsOnReplace
void HandleSkipCharsOnReplace (object sender, DocumentChangeEventArgs args)
{
var skipChars = GetTextEditorData ().SkipChars;
for (int i = 0; i < skipChars.Count; i++) {
var sc = skipChars [i];
if (args.Offset > sc.Offset) {
skipChars.RemoveAt (i);
i--;
continue;
}
if (args.Offset <= sc.Offset) {
sc.Offset += args.ChangeDelta;
}
}
}
示例3: OnTextReplacing
void OnTextReplacing (object s, DocumentChangeEventArgs a)
{
oldReplaceText = a.RemovedText;
}
示例4: HandleTextEditorDataDocumentTextReplaced
void HandleTextEditorDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
{
RemoveMarkers (false);
}
示例5: HandleTextReplacing
void HandleTextReplacing (object sender, DocumentChangeEventArgs e)
{
wasInVerbatimString = null;
var o = e.Offset + e.RemovalLength;
if (o < 0 || o + 1 > textEditorData.Length || e.RemovalLength != 1 || textEditorData.Document.IsInUndo) {
return;
}
if (textEditorData.GetCharAt (o) != '"')
return;
SafeUpdateIndentEngine (o + 1);
wasInVerbatimString = stateTracker.IsInsideVerbatimString;
}
示例6: OnTextReplacing
protected virtual void OnTextReplacing (DocumentChangeEventArgs args)
{
if (TextReplacing != null)
TextReplacing (this, args);
}
示例7: HandleTextReplaced
void HandleTextReplaced (object sender, DocumentChangeEventArgs args)
{
if (Document.CurrentAtomicUndoOperationType == OperationType.Format)
return;
int startIndex = args.Offset;
foreach (var marker in currentErrorMarkers) {
var line = marker.LineSegment;
if (line == null || line.Contains (args.Offset) || line.Contains (args.Offset + args.InsertionLength) || args.Offset < line.Offset && line.Offset < args.Offset + args.InsertionLength) {
markersToRemove.Enqueue (marker);
}
}
ResetRemoveMarker ();
}
示例8: HandleInfoDocumentTextEditorDataDocumentTextReplaced
void HandleInfoDocumentTextEditorDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
{
foreach (var data in localUpdate.ToArray ()) {
data.Document.TextReplaced -= HandleDataDocumentTextReplaced;
data.Replace (e.Offset, e.RemovalLength, e.InsertedText.Text);
data.Document.TextReplaced += HandleDataDocumentTextReplaced;
data.Document.CommitUpdateAll ();
}
}
示例9: HandleDataDocumentTextReplaced
void HandleDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
{
var data = dict [(TextDocument)sender];
localUpdate.Remove (data);
var editor = info.Document.GetContent<MonoDevelop.Ide.Editor.ITextDocument> ();
editor.ReplaceText (e.Offset, e.RemovalLength, e.InsertedText.Text);
localUpdate.Add (data);
UpdateDiff ();
}
示例10: HandleTextReplaced
void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
{
if (e.RemovalLength != 1 || textEditorData.Document.CurrentAtomicUndoOperationType == OperationType.Format) {
return;
}
stateTracker.UpdateEngine (Math.Min (textEditorData.Document.TextLength, e.Offset + e.InsertionLength + 1));
if (wasInVerbatimString && !stateTracker.Engine.IsInsideVerbatimString) {
textEditorData.Document.TextReplacing -= HandleTextReplacing;
textEditorData.Document.TextReplaced -= HandleTextReplaced;;
ConvertVerbatimStringToNormal (textEditorData, e.Offset + e.InsertionLength + 1);
textEditorData.Document.TextReplacing += HandleTextReplacing;
textEditorData.Document.TextReplaced += HandleTextReplaced;;
}
}
示例11: EditorDocumentTextReplacing
/// <summary>
/// Marks necessary lines modified when text is replaced
/// </summary>
private void EditorDocumentTextReplacing (object sender, DocumentChangeEventArgs e)
{
int startLine = widget.Editor.Document.OffsetToLineNumber (e.Offset),
endLine = widget.Editor.Document.OffsetToLineNumber (e.Offset + Math.Max (e.RemovalLength, e.InsertionLength)),
lineCount = 0;
string[] tokens = null;
if (startLine < endLine) {
// change crosses line boundary
lineCount = endLine - startLine;
lineCount = Math.Min (lineCount, annotations.Count - startLine);
if (lineCount > 0)
annotations.RemoveRange (startLine - 1, lineCount);
if (!string.IsNullOrEmpty (e.InsertedText.Text)) {
for (int i=0; i<lineCount; ++i)
annotations.Insert (startLine - 1, locallyModified);
}
return;
} else if (0 == e.RemovalLength) {
// insert
tokens = e.InsertedText.Text.Split (new string[]{Environment.NewLine}, StringSplitOptions.None);
lineCount = tokens.Length - 1;
for (int i=0; i<lineCount; ++i) {
annotations.Insert (Math.Min (startLine, annotations.Count), locallyModified);
}
} else if (startLine > endLine) {
// revert
UpdateAnnotations (null, null);
return;
}
SetAnnotation (startLine, locallyModified);
}
示例12: HandleDataDocumentTextReplaced
void HandleDataDocumentTextReplaced (object sender, DocumentChangeEventArgs e)
{
var data = dict [(TextDocument)sender];
localUpdate.Remove (data);
var editor = info.Document.GetContent<IEditableTextFile> ();
editor.DeleteText (e.Offset, e.RemovalLength);
editor.InsertText (e.Offset, e.InsertedText.Text);
localUpdate.Add (data);
UpdateDiff ();
}
示例13: OnTextReplacing
void OnTextReplacing (object sender, DocumentChangeEventArgs e)
{
if (lastChange == null)
lastChange = new ChangeInfo (e.Offset, new SeekableTextReader((sender as TextDocument).Text));
if (e.ChangeDelta > 0) {
lastChange.Length += e.InsertionLength;
} else {
lastChange.Length -= e.RemovalLength;
}
}
示例14: BufferChanged
private void BufferChanged (object sender, DocumentChangeEventArgs args)
{
if (TextChanged != null)
TextChanged (this, EventArgs.Empty);
}
示例15: HandleTextReplaced
void HandleTextReplaced (object sender, DocumentChangeEventArgs e)
{
caret.UpdateCaretPosition ();
}