Description of Bookmark.
コード例 #1
0
		/// <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);
		}
コード例 #2
0
		bool IsClassMemberBookmark(Bookmark b)
		{
			return b is Bookmarks.ClassMemberBookmark || b is Bookmarks.ClassBookmark;
		}
コード例 #3
0
 public void AddMark(Bookmark mark)
 {
     bookmark.Add(mark);
     OnAdded(new BookmarkEventArgs(mark));
     OnChanged(EventArgs.Empty);
 }
コード例 #4
0
 bool AcceptAnyMarkPredicate(Bookmark mark)
 {
     return true;
 }
コード例 #5
0
 public void RemoveMark(Bookmark mark)
 {
     bookmark.Remove(mark);
     OnRemoved(new BookmarkEventArgs(mark));
     OnChanged(EventArgs.Empty);
 }
コード例 #6
0
		public BookmarkEventArgs(Bookmark bookmark)
		{
			this.bookmark = bookmark;
		}
コード例 #7
0
		public void AddMark(Bookmark mark)
		{
			bookmark.Add(mark);
			OnAdded(new BookmarkEventArgs(mark));
		}
コード例 #8
0
        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();
        }
コード例 #9
0
		public void RemoveMark(Bookmark mark)
		{
			bookmark.Remove(mark);
			OnRemoved(new BookmarkEventArgs(mark));
		}
コード例 #10
0
 public void RemoveMark(Bookmark mark)
 {
     _bookmark.Remove(mark);
     OnRemoved(new BookmarkEventArgs(mark));
 }
コード例 #11
0
 public void AddMark(Bookmark mark)
 {
     _bookmark.Add(mark);
     OnAdded(new BookmarkEventArgs(mark));
 }
コード例 #12
0
 bool AcceptAnyMarkPredicate(Bookmark mark)
 {
     return(true);
 }
コード例 #13
0
 public BookmarkEventArgs(Bookmark bookmark)
 {
     Bookmark = bookmark;
 }
コード例 #14
0
 public BookmarkEventArgs(Bookmark bookmark)
 {
     this.bookmark = bookmark;
 }