/// <summary> /// Sets the mark at the line <code>lineNr</code> if it is not set, if the /// line is already marked the mark is cleared. /// </summary> public void ToggleMarkAt(int lineNr) { Bookmark newMark; if (factory != null) newMark = factory.CreateBookmark(document, lineNr); else newMark = new Bookmark(document, lineNr); Type newMarkType = newMark.GetType(); for (int i = 0; i < bookmark.Count; ++i) { Bookmark mark = bookmark[i]; if (mark.LineNumber == lineNr && mark.CanToggle && mark.GetType() == newMarkType) { bookmark.RemoveAt(i); OnRemoved(new BookmarkEventArgs(mark)); OnChanged(EventArgs.Empty); return; } } bookmark.Add(newMark); OnAdded(new BookmarkEventArgs(newMark)); OnChanged(EventArgs.Empty); }
bool IsClassMemberBookmark(Bookmark b) { return b is Bookmarks.ClassMemberBookmark || b is Bookmarks.ClassBookmark; }
public void AddMark(Bookmark mark) { bookmark.Add(mark); OnAdded(new BookmarkEventArgs(mark)); OnChanged(EventArgs.Empty); }
bool AcceptAnyMarkPredicate(Bookmark mark) { return true; }
public void RemoveMark(Bookmark mark) { bookmark.Remove(mark); OnRemoved(new BookmarkEventArgs(mark)); OnChanged(EventArgs.Empty); }
public BookmarkEventArgs(Bookmark bookmark) { this.bookmark = bookmark; }
public void AddMark(Bookmark mark) { bookmark.Add(mark); OnAdded(new BookmarkEventArgs(mark)); }
public void setSelectedText(int line, int column, bool showAsError, bool showAsBookMark, bool decrementLineAndColumn) { this.invokeOnThread( () => { if (decrementLineAndColumn) { line--; // since the first line is at 0 column--; // same for column } //var text = tecSourceCode.ActiveTextAreaControl.TextArea.Text; var location = new TextLocation(column, line); var bookmark = new Bookmark(tecSourceCode.Document, location); if (showAsBookMark) tecSourceCode.Document.BookmarkManager.AddMark(bookmark); if (showAsError) { var offset = bookmark.Anchor.Offset; var length = bookmark.Anchor.Line.Length - column; var newMarker = new TextMarker(offset, length, TextMarkerType.WaveLine); tecSourceCode.Document.MarkerStrategy.AddMarker(newMarker); } refresh(); }); // tecSourceCode.ActiveTextAreaControl.Refresh(); }
public void RemoveMark(Bookmark mark) { bookmark.Remove(mark); OnRemoved(new BookmarkEventArgs(mark)); }
public void RemoveMark(Bookmark mark) { _bookmark.Remove(mark); OnRemoved(new BookmarkEventArgs(mark)); }
public void AddMark(Bookmark mark) { _bookmark.Add(mark); OnAdded(new BookmarkEventArgs(mark)); }
bool AcceptAnyMarkPredicate(Bookmark mark) { return(true); }
public BookmarkEventArgs(Bookmark bookmark) { Bookmark = bookmark; }