本文整理汇总了C#中Mono.TextEditor.TextLineMarker类的典型用法代码示例。如果您正苦于以下问题:C# TextLineMarker类的具体用法?C# TextLineMarker怎么用?C# TextLineMarker使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextLineMarker类属于Mono.TextEditor命名空间,在下文中一共展示了TextLineMarker类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMarker
internal void AddMarker (TextLineMarker marker)
{
if (markers == null)
markers = new List<TextLineMarker> ();
marker.LineSegment = this;
markers.Add (marker);
}
示例2: RemoveMarker
internal void RemoveMarker (TextLineMarker marker)
{
marker.LineSegment = null;
if (markers == null)
return;
markers.Remove (marker);
if (markers.Count == 0)
markers = null;
}
示例3: RemoveMarker
public void RemoveMarker (TextLineMarker marker)
{
RemoveMarker (marker, true);
}
示例4: AddMarker
public void AddMarker (DocumentLine line, TextLineMarker marker, bool commitUpdate)
{
if (line == null || marker == null)
return;
if (marker is IExtendingTextLineMarker) {
lock (extendingTextMarkers) {
HeightChanged = true;
extendingTextMarkers.Add (marker);
extendingTextMarkers.Sort (CompareMarkers);
}
}
line.AddMarker (marker);
OnMarkerAdded (new TextMarkerEvent (line, marker));
if (commitUpdate)
this.CommitLineUpdate (line);
}
示例5: CompareMarkers
static int CompareMarkers (TextLineMarker left, TextLineMarker right)
{
if (left.LineSegment == null || right.LineSegment == null)
return 0;
return left.LineSegment.Offset.CompareTo (right.LineSegment.Offset);
}
示例6: AddMarker
internal void AddMarker (TextLineMarker marker, int idx = -1)
{
if (markers == null)
markers = new List<TextLineMarker> ();
marker.LineSegment = this;
if (idx < 0) {
markers.Add (marker);
} else {
markers.Insert (idx, marker);
}
}
示例7: TextMarkerEvent
public TextMarkerEvent (DocumentLine line, TextLineMarker textMarker) : base (line)
{
this.TextMarker = textMarker;
}
示例8: Dispose
public override void Dispose ()
{
ClearExtensions ();
FileRegistry.Remove (this);
RemoveAutoSaveTimer ();
StoreSettings ();
this.isDisposed = true;
Counters.LoadedEditors--;
/* if (messageBubbleHighlightPopupWindow != null)
messageBubbleHighlightPopupWindow.Destroy ();*/
IdeApp.Preferences.DefaultHideMessageBubblesChanged -= HandleIdeAppPreferencesDefaultHideMessageBubblesChanged;
IdeApp.Preferences.ShowMessageBubblesChanged -= HandleIdeAppPreferencesShowMessageBubblesChanged;
TaskService.TaskToggled -= HandleErrorListPadTaskToggled;
DisposeErrorMarkers ();
ClipbardRingUpdated -= UpdateClipboardRing;
widget.TextEditor.Document.SyntaxModeChanged -= HandleSyntaxModeChanged;
widget.TextEditor.Document.TextReplaced -= HandleTextReplaced;
widget.TextEditor.Document.LineChanged -= HandleLineChanged;
widget.TextEditor.Document.BeginUndo -= HandleBeginUndo;
widget.TextEditor.Document.EndUndo -= HandleEndUndo;
widget.TextEditor.Document.Undone -= HandleUndone;
widget.TextEditor.Document.Redone -= HandleUndone;
widget.TextEditor.Caret.PositionChanged -= HandlePositionChanged;
widget.TextEditor.IconMargin.ButtonPressed -= OnIconButtonPress;
widget.TextEditor.Document.TextReplacing -= OnTextReplacing;
widget.TextEditor.Document.TextReplaced -= OnTextReplaced;
widget.TextEditor.Document.ReadOnlyCheckDelegate = null;
widget.TextEditor.Options.Changed -= HandleWidgetTextEditorOptionsChanged;
TextEditorService.FileExtensionAdded -= HandleFileExtensionAdded;
TextEditorService.FileExtensionRemoved -= HandleFileExtensionRemoved;
DebuggingService.DebugSessionStarted -= OnDebugSessionStarted;
DebuggingService.CurrentFrameChanged -= currentFrameChanged;
DebuggingService.StoppedEvent -= currentFrameChanged;
DebuggingService.ResumedEvent -= currentFrameChanged;
breakpoints.BreakpointAdded -= breakpointAdded;
breakpoints.BreakpointRemoved -= breakpointRemoved;
breakpoints.BreakpointStatusChanged -= breakpointStatusChanged;
breakpoints.BreakpointModified -= breakpointStatusChanged;
DebuggingService.PinnedWatches.WatchAdded -= OnWatchAdded;
DebuggingService.PinnedWatches.WatchRemoved -= OnWatchRemoved;
DebuggingService.PinnedWatches.WatchChanged -= OnWatchChanged;
TaskService.Errors.TasksAdded -= UpdateTasks;
TaskService.Errors.TasksRemoved -= UpdateTasks;
TaskService.Errors.TasksChanged -= UpdateTasks;
TaskService.JumpedToTask -= HandleTaskServiceJumpedToTask;
// This is not necessary but helps when tracking down memory leaks
debugStackLineMarker = null;
currentDebugLineMarker = null;
currentFrameChanged = null;
breakpointAdded = null;
breakpointRemoved = null;
breakpointStatusChanged = null;
if (ownerDocument != null) {
ownerDocument.DocumentParsed -= HandleDocumentParsed;
ownerDocument = null;
}
RemoveMarkerQueue ();
}
示例9: SourceEditorView
public SourceEditorView ()
{
Counters.LoadedEditors++;
currentFrameChanged = (EventHandler)DispatchService.GuiDispatch (new EventHandler (OnCurrentFrameChanged));
breakpointAdded = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointAdded));
breakpointRemoved = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointRemoved));
breakpointStatusChanged = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointStatusChanged));
widget = new SourceEditorWidget (this);
widget.TextEditor.Document.SyntaxModeChanged += HandleSyntaxModeChanged;
widget.TextEditor.Document.TextReplaced += HandleTextReplaced;
widget.TextEditor.Document.LineChanged += HandleLineChanged;
widget.TextEditor.Document.BeginUndo += HandleBeginUndo;
widget.TextEditor.Document.EndUndo += HandleEndUndo;
widget.TextEditor.Document.Undone += HandleUndone;
widget.TextEditor.Document.Redone += HandleUndone;
widget.TextEditor.Document.TextReplacing += OnTextReplacing;
widget.TextEditor.Document.TextReplaced += OnTextReplaced;
widget.TextEditor.Document.ReadOnlyCheckDelegate = CheckReadOnly;
// widget.TextEditor.Document.DocumentUpdated += delegate {
// this.IsDirty = Document.IsDirty;
// };
widget.TextEditor.Caret.PositionChanged += HandlePositionChanged;
widget.TextEditor.IconMargin.ButtonPressed += OnIconButtonPress;
debugStackLineMarker = new DebugStackLineTextMarker (widget.TextEditor);
currentDebugLineMarker = new CurrentDebugLineTextMarker (widget.TextEditor);
this.WorkbenchWindowChanged += HandleWorkbenchWindowChanged;
this.ContentNameChanged += delegate {
this.Document.FileName = this.ContentName;
if (String.IsNullOrEmpty (ContentName) || !File.Exists (ContentName))
return;
lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName);
};
ClipbardRingUpdated += UpdateClipboardRing;
TextEditorService.FileExtensionAdded += HandleFileExtensionAdded;
TextEditorService.FileExtensionRemoved += HandleFileExtensionRemoved;
breakpoints = DebuggingService.Breakpoints;
DebuggingService.DebugSessionStarted += OnDebugSessionStarted;
DebuggingService.CurrentFrameChanged += currentFrameChanged;
DebuggingService.StoppedEvent += currentFrameChanged;
DebuggingService.ResumedEvent += currentFrameChanged;
breakpoints.BreakpointAdded += breakpointAdded;
breakpoints.BreakpointRemoved += breakpointRemoved;
breakpoints.BreakpointStatusChanged += breakpointStatusChanged;
breakpoints.BreakpointModified += breakpointStatusChanged;
DebuggingService.PinnedWatches.WatchAdded += OnWatchAdded;
DebuggingService.PinnedWatches.WatchRemoved += OnWatchRemoved;
DebuggingService.PinnedWatches.WatchChanged += OnWatchChanged;
TaskService.Errors.TasksAdded += UpdateTasks;
TaskService.Errors.TasksRemoved += UpdateTasks;
TaskService.JumpedToTask += HandleTaskServiceJumpedToTask;
IdeApp.Preferences.ShowMessageBubblesChanged += HandleIdeAppPreferencesShowMessageBubblesChanged;
TaskService.TaskToggled += HandleErrorListPadTaskToggled;
widget.TextEditor.Options.Changed += HandleWidgetTextEditorOptionsChanged;
IdeApp.Preferences.DefaultHideMessageBubblesChanged += HandleIdeAppPreferencesDefaultHideMessageBubblesChanged;
Document.AddAnnotation (this);
FileRegistry.Add (this);
}
示例10: SourceEditorView
public SourceEditorView ()
{
Counters.LoadedEditors++;
currentFrameChanged = (EventHandler)DispatchService.GuiDispatch (new EventHandler (OnCurrentFrameChanged));
breakpointAdded = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointAdded));
breakpointRemoved = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointRemoved));
breakpointStatusChanged = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointStatusChanged));
widget = new SourceEditorWidget (this);
widget.TextEditor.Document.SyntaxModeChanged += delegate(object sender, SyntaxModeChangeEventArgs e) {
var oldProvider = e.OldMode as IQuickTaskProvider;
if (oldProvider != null)
widget.RemoveQuickTaskProvider (oldProvider);
var newProvider = e.NewMode as IQuickTaskProvider;
if (newProvider != null)
widget.AddQuickTaskProvider (newProvider);
};
widget.TextEditor.Document.TextReplaced += delegate(object sender, DocumentChangeEventArgs args) {
if (!inLoad) {
if (widget.TextEditor.Document.IsInAtomicUndo) {
wasEdited = true;
} else {
InformAutoSave ();
}
}
int startIndex = args.Offset;
int endIndex = startIndex + Math.Max (args.RemovalLength, args.InsertionLength);
if (TextChanged != null)
TextChanged (this, new TextChangedEventArgs (startIndex, endIndex));
foreach (var marker in currentErrorMarkers) {
if (marker.LineSegment.Contains (args.Offset) || marker.LineSegment.Contains (args.Offset + args.InsertionLength) || args.Offset < marker.LineSegment.Offset && marker.LineSegment.Offset < args.Offset + args.InsertionLength) {
markersToRemove.Enqueue (marker);
}
}
ResetRemoveMarker ();
};
widget.TextEditor.Document.LineChanged += delegate(object sender, LineEventArgs e) {
UpdateBreakpoints ();
UpdateWidgetPositions ();
if (messageBubbleCache != null && messageBubbleCache.RemoveLine (e.Line)) {
MessageBubbleTextMarker marker = currentErrorMarkers.FirstOrDefault (m => m.LineSegment == e.Line);
if (marker != null) {
widget.TextEditor.TextViewMargin.RemoveCachedLine (e.Line);
// ensure that the line cache is renewed
marker.GetLineHeight (widget.TextEditor);
}
}
};
widget.TextEditor.Document.BeginUndo += delegate {
wasEdited = false;
};
widget.TextEditor.Document.EndUndo += delegate {
if (wasEdited)
InformAutoSave ();
};
widget.TextEditor.Document.Undone += (o, a) => AutoSave.InformAutoSaveThread (Document);
widget.TextEditor.Document.Redone += (o, a) => AutoSave.InformAutoSaveThread (Document);
widget.TextEditor.Document.TextReplacing += OnTextReplacing;
widget.TextEditor.Document.TextReplaced += OnTextReplaced;
widget.TextEditor.Document.ReadOnlyCheckDelegate = CheckReadOnly;
// widget.TextEditor.Document.DocumentUpdated += delegate {
// this.IsDirty = Document.IsDirty;
// };
widget.TextEditor.Caret.PositionChanged += delegate {
OnCaretPositionSet (EventArgs.Empty);
FireCompletionContextChanged ();
};
widget.TextEditor.IconMargin.ButtonPressed += OnIconButtonPress;
debugStackLineMarker = new DebugStackLineTextMarker (widget.TextEditor);
currentDebugLineMarker = new CurrentDebugLineTextMarker (widget.TextEditor);
this.WorkbenchWindowChanged += HandleWorkbenchWindowChanged;
this.ContentNameChanged += delegate {
this.Document.FileName = this.ContentName;
if (String.IsNullOrEmpty (ContentName) || !File.Exists (ContentName))
return;
lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName);
};
ClipbardRingUpdated += UpdateClipboardRing;
TextEditorService.FileExtensionAdded += HandleFileExtensionAdded;
TextEditorService.FileExtensionRemoved += HandleFileExtensionRemoved;
DebuggingService.DebugSessionStarted += OnDebugSessionStarted;
DebuggingService.CurrentFrameChanged += currentFrameChanged;
DebuggingService.StoppedEvent += currentFrameChanged;
DebuggingService.ResumedEvent += currentFrameChanged;
DebuggingService.Breakpoints.BreakpointAdded += breakpointAdded;
DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemoved;
DebuggingService.Breakpoints.BreakpointStatusChanged += breakpointStatusChanged;
DebuggingService.Breakpoints.BreakpointModified += breakpointStatusChanged;
//.........这里部分代码省略.........