This class handles the bookmarks for a buffer
Exemplo n.º 1
0
        void OnTextEditorKeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode != Keys.F9)
            {
                return;
            }

            ICSharpCode.TextEditor.TextArea area_obj = (ICSharpCode.TextEditor.TextArea)sender;

            ICSharpCode.TextEditor.Document.LineSegment l = area_obj.Document.GetLineSegment(area_obj.Caret.Line);
            string s = area_obj.Document.GetText(l);

            if (s.Trim().Length == 0)
            {
                return;
            }

            ICSharpCode.TextEditor.Document.BookmarkManager bm = this.textEditor.Document.BookmarkManager;

            if (bm.IsMarked(area_obj.Caret.Line))
            {
                bm.RemoveMark(bm.GetNextMark(area_obj.Caret.Line - 1));
            }
            else
            {
                this.textEditor.Document.BookmarkManager.AddMark(new Breakpoint(this._filename, this.textEditor.Document, area_obj.Caret.Line));
            }

            // this.textEditor.Document.RequestUpdate(new TextAreaUpdate(TextAreaUpdateType.SingleLine, area_obj.Caret.Line));

            this.RedrawBreakpoints();

            // area_obj.IconBarMargin.Paint(area_obj.IconBarMargin.TextArea.CreateGraphics(), area_obj.IconBarMargin.TextArea.DisplayRectangle);
        }
Exemplo n.º 2
0
 void AddClassMemberBookmarks(ICSharpCode.TextEditor.Document.BookmarkManager bm, IClass c)
 {
     if (c.IsSynthetic)
     {
         return;
     }
     if (!c.Region.IsEmpty)
     {
         bm.AddMark(new ICSharpCode.SharpDevelop.Bookmarks.ClassBookmark(textEditorControl.Document, c));
     }
     foreach (IClass innerClass in c.InnerClasses)
     {
         AddClassMemberBookmarks(bm, innerClass);
     }
     foreach (IMethod m in c.Methods)
     {
         if (m.Region.IsEmpty || m.IsSynthetic)
         {
             continue;
         }
         bm.AddMark(new ICSharpCode.SharpDevelop.Bookmarks.MethodBookmark(textEditorControl.Document, m));
     }
     foreach (IProperty m in c.Properties)
     {
         if (m.Region.IsEmpty || m.IsSynthetic)
         {
             continue;
         }
         bm.AddMark(new ICSharpCode.SharpDevelop.Bookmarks.PropertyBookmark(textEditorControl.Document, m));
     }
     foreach (IField f in c.Fields)
     {
         if (f.Region.IsEmpty || f.IsSynthetic)
         {
             continue;
         }
         bm.AddMark(new ICSharpCode.SharpDevelop.Bookmarks.FieldBookmark(textEditorControl.Document, f));
     }
     foreach (IEvent e in c.Events)
     {
         if (e.Region.IsEmpty || e.IsSynthetic)
         {
             continue;
         }
         bm.AddMark(new ICSharpCode.SharpDevelop.Bookmarks.EventBookmark(textEditorControl.Document, e));
     }
 }
Exemplo n.º 3
0
 void UpdateClassMemberBookmarks(ParseInformation parseInfo)
 {
     ICSharpCode.TextEditor.Document.BookmarkManager bm = textEditorControl.Document.BookmarkManager;
     bm.RemoveMarks(new Predicate <Bookmark>(IsClassMemberBookmark));
     if (parseInfo == null)
     {
         return;
     }
     Debug.Assert(textEditorControl.Document.TotalNumberOfLines >= 1);
     if (textEditorControl.Document.TotalNumberOfLines < 1)
     {
         return;
     }
     foreach (IClass c in parseInfo.MostRecentCompilationUnit.Classes)
     {
         AddClassMemberBookmarks(bm, c);
     }
 }
		void AddClassMemberBookmarks(BookmarkManager bm, IClass c)
		{
			if (c.IsSynthetic) return;
			if (!c.Region.IsEmpty) {
				bm.AddMark(new Bookmarks.ClassBookmark(textEditorControl.Document, c));
			}
			foreach (IClass innerClass in c.InnerClasses) {
				AddClassMemberBookmarks(bm, innerClass);
			}
			foreach (IMethod m in c.Methods) {
				if (m.Region.IsEmpty || m.IsSynthetic) continue;
				bm.AddMark(new Bookmarks.MethodBookmark(textEditorControl.Document, m));
			}
			foreach (IProperty m in c.Properties) {
				if (m.Region.IsEmpty || m.IsSynthetic) continue;
				bm.AddMark(new Bookmarks.PropertyBookmark(textEditorControl.Document, m));
			}
			foreach (IField f in c.Fields) {
				if (f.Region.IsEmpty || f.IsSynthetic) continue;
				bm.AddMark(new Bookmarks.FieldBookmark(textEditorControl.Document, f));
			}
			foreach (IEvent e in c.Events) {
				if (e.Region.IsEmpty || e.IsSynthetic) continue;
				bm.AddMark(new Bookmarks.EventBookmark(textEditorControl.Document, e));
			}
		}
Exemplo n.º 5
0
		public SDBookmarkFactory(ICSharpCode.TextEditor.Document.BookmarkManager manager)
		{
			this.manager = manager;
		}
Exemplo n.º 6
0
 public SDBookmarkFactory(ICSharpCode.TextEditor.Document.BookmarkManager manager)
 {
     this.manager = manager;
 }