Browse Source

Breakpoints are now a special kind of bookmarks.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@143 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
96160bb80d
  1. 25
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/BreakPointsPad.cs
  2. 52
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/BookmarkManager/Bookmark.cs
  3. 49
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/BookmarkManager/BookmarkManager.cs
  4. 41
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs
  5. 30
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/IconBarMargin.cs
  6. 10
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs
  7. 33
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  8. 2
      src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs
  9. 55
      src/Main/Base/Project/Src/Services/Debugger/DebugClasses.cs
  10. 94
      src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs
  11. 60
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Bookmark.cs
  12. 8
      src/Main/Base/Project/Src/TextEditor/Bookmarks/BookmarkEventHandler.cs
  13. 34
      src/Main/Base/Project/Src/TextEditor/Bookmarks/BookmarkManager.cs
  14. 2
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Commands/MenuCommands.cs
  15. 10
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs
  16. 2
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPadToolbarCommands.cs
  17. 12
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkFolderNode.cs
  18. 8
      src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkNode.cs
  19. 44
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs
  20. 6
      src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

25
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/BreakPointsPad.cs

@ -89,31 +89,46 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -89,31 +89,46 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
breakpointsList.BeginUpdate();
breakpointsList.Items.Clear();
foreach(DebuggerLibrary.Breakpoint b in NDebugger.Instance.Breakpoints) {
AddBreakpoint(this, new BreakpointEventArgs(b));
AddBreakpoint(new BreakpointEventArgs(b));
}
breakpointsList.EndUpdate();
breakpointsList.ItemCheck += new ItemCheckEventHandler(BreakpointsListItemCheck);
}
void AddBreakpoint(object sender, BreakpointEventArgs e)
{
breakpointsList.ItemCheck -= new ItemCheckEventHandler(BreakpointsListItemCheck);
AddBreakpoint(e);
breakpointsList.ItemCheck += new ItemCheckEventHandler(BreakpointsListItemCheck);
}
void AddBreakpoint(BreakpointEventArgs e)
{
ListViewItem item = new ListViewItem();
item.Tag = e.Breakpoint;
breakpointsList.Items.Add(item);
RefreshBreakpoint(this, e);
RefreshBreakpoint(item, e);
}
void RefreshBreakpoint(object sender, BreakpointEventArgs e)
{
breakpointsList.ItemCheck -= new ItemCheckEventHandler(BreakpointsListItemCheck);
foreach (ListViewItem item in breakpointsList.Items) {
if (e.Breakpoint == item.Tag) {
RefreshBreakpoint(item, e);
break;
}
}
breakpointsList.ItemCheck += new ItemCheckEventHandler(BreakpointsListItemCheck);
}
void RefreshBreakpoint(ListViewItem item, BreakpointEventArgs e)
{
item.SubItems.Clear();
item.Checked = e.Breakpoint.Enabled;
item.Text = Path.GetFileName(e.Breakpoint.SourcecodeSegment.SourceFullFilename) + ", Line = " + e.Breakpoint.SourcecodeSegment.StartLine.ToString();
item.ForeColor = e.Breakpoint.HadBeenSet ? Color.Black : Color.Gray;
item.SubItems.AddRange(new string[] {Path.GetDirectoryName(e.Breakpoint.SourcecodeSegment.SourceFullFilename)});
}
}
item.SubItems.AddRange(new string[] { Path.GetDirectoryName(e.Breakpoint.SourcecodeSegment.SourceFullFilename) });
}
void RemoveBreakpoint(object sender, BreakpointEventArgs e)

52
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/BookmarkManager/Bookmark.cs

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
/*
* Created by SharpDevelop.
* User: Omnibrain
* Date: 26.12.2004
* Time: 19:25
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version value="$version"/>
// </file>
using System;
using System.Drawing;
using SWF = System.Windows.Forms;
namespace ICSharpCode.TextEditor.Document
{
@ -24,6 +24,9 @@ namespace ICSharpCode.TextEditor.Document @@ -24,6 +24,9 @@ namespace ICSharpCode.TextEditor.Document
get {
return document;
}
set {
document = value;
}
}
public bool IsEnabled {
@ -42,7 +45,28 @@ namespace ICSharpCode.TextEditor.Document @@ -42,7 +45,28 @@ namespace ICSharpCode.TextEditor.Document
return lineNumber;
}
set {
if (lineNumber != value) {
lineNumber = value;
OnLineNumberChanged(EventArgs.Empty);
}
}
}
public event EventHandler LineNumberChanged;
protected virtual void OnLineNumberChanged(EventArgs e)
{
if (LineNumberChanged != null) {
LineNumberChanged(this, e);
}
}
/// <summary>
/// Gets if the bookmark can be toggled off using the 'set/unset bookmark' command.
/// </summary>
public virtual bool CanToggle {
get {
return true;
}
}
@ -56,5 +80,17 @@ namespace ICSharpCode.TextEditor.Document @@ -56,5 +80,17 @@ namespace ICSharpCode.TextEditor.Document
this.lineNumber = lineNumber;
this.isEnabled = isEnabled;
}
public virtual void Click(SWF.MouseButtons mouseButtons)
{
if (mouseButtons == SWF.MouseButtons.Left) {
document.BookmarkManager.RemoveMark(this);
}
}
public virtual void Draw(IconBarMargin margin, Graphics g, Point p)
{
margin.DrawBookmark(g, p.Y, isEnabled);
}
}
}

49
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/BookmarkManager/BookmarkManager.cs

@ -10,6 +10,11 @@ using System.Collections.Generic; @@ -10,6 +10,11 @@ using System.Collections.Generic;
namespace ICSharpCode.TextEditor.Document
{
public interface IBookmarkFactory
{
Bookmark CreateBookmark(IDocument document, int lineNumber);
}
/// <summary>
/// This class handles the bookmarks for a buffer
/// </summary>
@ -27,6 +32,12 @@ namespace ICSharpCode.TextEditor.Document @@ -27,6 +32,12 @@ namespace ICSharpCode.TextEditor.Document
}
}
public IDocument Document {
get {
return document;
}
}
/// <summary>
/// Creates a new instance of <see cref="BookmarkManager"/>
/// </summary>
@ -36,27 +47,56 @@ namespace ICSharpCode.TextEditor.Document @@ -36,27 +47,56 @@ namespace ICSharpCode.TextEditor.Document
lineTracker.LineCountChanged += new LineManagerEventHandler(MoveIndices);
}
/// <remarks>
IBookmarkFactory factory;
public IBookmarkFactory Factory {
get {
return factory;
}
set {
factory = value;
}
}
/// <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.
/// </remarks>
/// </summary>
public void ToggleMarkAt(int lineNr)
{
for (int i = 0; i < bookmark.Count; ++i) {
if (bookmark[i].LineNumber == lineNr) {
Bookmark mark = bookmark[i];
if (mark.LineNumber == lineNr && mark.CanToggle) {
bookmark.RemoveAt(i);
OnRemoved(new BookmarkEventArgs(mark));
OnChanged(EventArgs.Empty);
return;
}
}
Bookmark newMark = new Bookmark(document, lineNr);
Bookmark newMark;
if (factory != null)
newMark = factory.CreateBookmark(document, lineNr);
else
newMark = new Bookmark(document, lineNr);
bookmark.Add(newMark);
OnAdded(new BookmarkEventArgs(newMark));
OnChanged(EventArgs.Empty);
}
public void AddMark(Bookmark mark)
{
bookmark.Add(mark);
OnAdded(new BookmarkEventArgs(mark));
OnChanged(EventArgs.Empty);
}
public void RemoveMark(Bookmark mark)
{
bookmark.Remove(mark);
OnRemoved(new BookmarkEventArgs(mark));
OnChanged(EventArgs.Empty);
}
/// <returns>
/// true, if a mark at mark exists, otherwise false
/// </returns>
@ -81,6 +121,7 @@ namespace ICSharpCode.TextEditor.Document @@ -81,6 +121,7 @@ namespace ICSharpCode.TextEditor.Document
Bookmark mark = bookmark[i];
if (e.LinesMoved < 0 && mark.LineNumber == e.LineStart) {
bookmark.RemoveAt(i);
OnRemoved(new BookmarkEventArgs(mark));
--i;
changed = true;
} else if (mark.LineNumber > e.LineStart + 1 || (e.LinesMoved < 0 && mark.LineNumber > e.LineStart)) {

41
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/FoldingStrategy/IndentFoldingStrategy.cs

@ -1,36 +1,47 @@ @@ -1,36 +1,47 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krger" email="mike@icsharpcode.net"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version value="$version"/>
// </file>
using System;
using System.Drawing;
using System.Collections;
using System.Collections.Generic;
namespace ICSharpCode.TextEditor.Document
{
/*
/// <summary>
/// A simple folding strategy which calculates the folding level
/// using the indent level of the line.
/// </summary>
public class IndentFoldingStrategy : IFoldingStrategy
{
/// <remarks>
/// Calculates the fold level of a specific line.
/// </remarks>
public int CalculateFoldLevel(IDocument document, int lineNumber)
public List<FoldMarker> GenerateFoldMarkers(IDocument document, string fileName, object parseInformation)
{
LineSegment line = document.GetLineSegment(lineNumber);
int foldLevel = 0;
while (document.GetCharAt(line.Offset + foldLevel) == '\t' && foldLevel + 1 < line.TotalLength) {
++foldLevel;
List<FoldMarker> l = new List<FoldMarker>();
Stack<int> offsetStack = new Stack<int>();
Stack<string> textStack = new Stack<string>();
//int level = 0;
//foreach (LineSegment segment in document.LineSegmentCollection) {
//
//}
return l;
}
return foldLevel;
int GetLevel(IDocument document, int offset)
{
int level = 0;
int spaces = 0;
for (int i = offset; i < document.TextLength; ++i) {
char c = document.GetCharAt(i);
if (c == '\t' || (c == ' ' && ++spaces == 4)) {
spaces = 0;
++level;
} else {
break;
}
}
return level;
}
}
}*/
}

30
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/IconBarMargin.cs

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version value="$version"/>
// </file>
using System;
using System.Windows.Forms;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
@ -53,13 +53,33 @@ namespace ICSharpCode.TextEditor @@ -53,13 +53,33 @@ namespace ICSharpCode.TextEditor
int lineNumber = textArea.Document.GetVisibleLine(mark.LineNumber);
int yPos = (int)(lineNumber * textArea.TextView.FontHeight) - textArea.VirtualTop.Y;
if (yPos >= rect.Y && yPos <= rect.Bottom) {
DrawBookmark(g, yPos, mark.IsEnabled);
//DrawBookmark(g, yPos, mark.IsEnabled);
mark.Draw(this, g, new Point(0, yPos));
}
}
base.Paint(g, rect);
}
#region Drawing functions
public override void HandleMouseDown(Point mousePos, MouseButtons mouseButtons)
{
List<Bookmark> marks = textArea.Document.BookmarkManager.Marks;
int oldCount = marks.Count;
foreach (Bookmark mark in marks) {
int lineNumber = textArea.Document.GetVisibleLine(mark.LineNumber);
int fontHeight = textArea.TextView.FontHeight;
int yPos = lineNumber * fontHeight - textArea.VirtualTop.Y;
if (mousePos.Y > yPos && mousePos.Y < yPos + fontHeight) {
mark.Click(mouseButtons);
if (oldCount != marks.Count) {
textArea.UpdateLine(lineNumber);
}
return;
}
}
base.HandleMouseDown(mousePos, mouseButtons);
}
#region Drawing functions
public void DrawBreakpoint(Graphics g, int y, bool isEnabled)
{
int delta = 1;
@ -200,6 +220,6 @@ namespace ICSharpCode.TextEditor @@ -200,6 +220,6 @@ namespace ICSharpCode.TextEditor
}
}
#endregion
#endregion
}
}

10
src/Libraries/ICSharpCode.TextEditor/Project/Src/Gui/TextView.cs

@ -110,9 +110,15 @@ namespace ICSharpCode.TextEditor @@ -110,9 +110,15 @@ namespace ICSharpCode.TextEditor
OptionsChanged();
}
static int GetFontHeight(Font font)
{
int h = font.Height;
return (h < 16) ? h + 1 : h;
}
public void OptionsChanged()
{
this.fontHeight = TextEditorProperties.Font.Height;
this.fontHeight = GetFontHeight(TextEditorProperties.Font);
if (this.charWitdh != null) {
this.charWitdh.Clear();
}
@ -126,7 +132,7 @@ namespace ICSharpCode.TextEditor @@ -126,7 +132,7 @@ namespace ICSharpCode.TextEditor
}
// Just to ensure that fontHeight and char widths are always correct...
if (fontHeight != TextEditorProperties.Font.Height) {
if (fontHeight != GetFontHeight(TextEditorProperties.Font)) {
OptionsChanged();
base.TextArea.Refresh();
return;

33
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -198,7 +198,7 @@ @@ -198,7 +198,7 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\TipOfTheDay.cs">
<SubType>Form</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\TreeViewOptions.cs">
<SubType>Form</SubType>
@ -266,7 +266,7 @@ @@ -266,7 +266,7 @@
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Pads\FileScout.cs">
<SubType>Component</SubType>
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Pads\OpenTaskView.cs" />
<Compile Include="Src\Gui\Pads\PropertyPad\PropertyPad.cs" />
@ -623,7 +623,9 @@ @@ -623,7 +623,9 @@
<Compile Include="Src\TextEditor\Gui\Editor\CodeCompletionBinding.cs" />
<Compile Include="Src\Gui\Pads\DefinitionViewPad.cs" />
<Compile Include="Src\Project\AdvancedMSBuildProject.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ApplicationSettings.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ApplicationSettings.cs">
<SubType>UserControl</SubType>
</Compile>
<EmbeddedResource Include="Resources\ProjectOptions\ApplicationSettings.xfrm" />
<Compile Include="Src\Gui\Pads\PropertyPad\IDEContainer.cs" />
<Compile Include="Src\Gui\Pads\PropertyPad\PropertyContainer.cs" />
@ -632,11 +634,21 @@ @@ -632,11 +634,21 @@
<EmbeddedResource Include="Resources\ProjectOptions\Signing.xfrm" />
<EmbeddedResource Include="Resources\ProjectOptions\BuildEvents.xfrm" />
<EmbeddedResource Include="Resources\ProjectOptions\DebugOptions.xfrm" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Signing.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ReferencePaths.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Publish.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\DebugOptions.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildEvents.cs" />
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Signing.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\ReferencePaths.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\Publish.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\DebugOptions.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\OptionPanels\ProjectOptions\BuildEvents.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Dom\ITypeParameter.cs" />
<Compile Include="Src\Dom\Implementations\DefaultTypeParameter.cs" />
<Compile Include="Src\Dom\Implementations\ProxyReturnType.cs" />
@ -647,7 +659,9 @@ @@ -647,7 +659,9 @@
<Compile Include="Src\Dom\Implementations\SpecificReturnType.cs" />
<Compile Include="Src\Dom\LanguageProperties.cs" />
<Compile Include="Src\Gui\BrowserDisplayBinding\SchemeExtension.cs" />
<Compile Include="Src\Gui\BrowserDisplayBinding\ExtendedWebBrowser.cs" />
<Compile Include="Src\Gui\BrowserDisplayBinding\ExtendedWebBrowser.cs">
<SubType>Component</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Libraries\DockPanel_Src\WinFormsUI\WinFormsUI.csproj">
@ -666,7 +680,6 @@ @@ -666,7 +680,6 @@
<Project>{35cef10f-2d4c-45f2-9dd1-161e0fec583c}</Project>
<Name>ICSharpCode.Core</Name>
</ProjectReference>
<Folder Include="Resources\ProjectOptions" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
</Project>

2
src/Main/Base/Project/Src/Gui/Workbench/Layouts/SdiWorkspaceLayout.cs

@ -319,6 +319,8 @@ namespace ICSharpCode.SharpDevelop.Gui @@ -319,6 +319,8 @@ namespace ICSharpCode.SharpDevelop.Gui
public PadContentWrapper(PadDescriptor padDescriptor)
{
if (padDescriptor == null)
throw new ArgumentNullException("padDescriptor");
this.padDescriptor = padDescriptor;
this.DockableAreas = ((((WeifenLuo.WinFormsUI.DockAreas.Float | WeifenLuo.WinFormsUI.DockAreas.DockLeft) |
WeifenLuo.WinFormsUI.DockAreas.DockRight) |

55
src/Main/Base/Project/Src/Services/Debugger/DebugClasses.cs

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krger" email="mike@icsharpcode.net"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version value="$version"/>
// </file>
@ -12,35 +12,44 @@ using System.CodeDom.Compiler; @@ -12,35 +12,44 @@ using System.CodeDom.Compiler;
using System.Collections;
using System.IO;
using System.Diagnostics;
using ICSharpCode.SharpDevelop.Bookmarks;
namespace ICSharpCode.Core
{
public class Breakpoint
{
string fileName;
int lineNumber;
BreakpointBookmark bookmark;
object tag;
bool isEnabled = true;
public BreakpointBookmark Bookmark {
get {
return bookmark;
}
}
public string FileName {
get {
return fileName;
return bookmark.FileName;
}
set {
fileName = value;
bookmark.FileName = value;
}
}
public int LineNumber {
get {
return lineNumber;
return bookmark.LineNumber + 1;
}
set {
lineNumber = value;
bookmark.LineNumber = value - 1;
}
}
public event EventHandler LineNumberChanged {
add { bookmark.LineNumberChanged += value; }
remove { bookmark.LineNumberChanged -= value; }
}
public object Tag {
get {
return tag;
@ -52,17 +61,37 @@ namespace ICSharpCode.Core @@ -52,17 +61,37 @@ namespace ICSharpCode.Core
public bool IsEnabled {
get {
return isEnabled;
return bookmark.IsEnabled;
}
set {
isEnabled = value;
bookmark.IsEnabled = value;
}
}
public Breakpoint(ICSharpCode.TextEditor.Document.IDocument document, string fileName, int lineNumber)
{
bookmark = new BreakpointBookmark(this, fileName, document, lineNumber - 1);
}
}
public Breakpoint(string fileName, int lineNumber)
public class BreakpointBookmark : SDBookmark
{
Breakpoint breakpoint;
public Breakpoint Breakpoint {
get {
return breakpoint;
}
}
public BreakpointBookmark(Breakpoint breakpoint, string fileName, ICSharpCode.TextEditor.Document.IDocument document, int lineNumber) : base(fileName, document, lineNumber)
{
this.breakpoint = breakpoint;
}
public override void Draw(ICSharpCode.TextEditor.IconBarMargin margin, Graphics g, Point p)
{
this.fileName = fileName;
this.lineNumber = lineNumber;
margin.DrawBreakpoint(g, p.Y, IsEnabled);
}
}

94
src/Main/Base/Project/Src/Services/Debugger/DebuggerService.cs

@ -20,6 +20,7 @@ using ICSharpCode.TextEditor.Document; @@ -20,6 +20,7 @@ using ICSharpCode.TextEditor.Document;
using ICSharpCode.TextEditor;
using System.Drawing;
using System.Windows.Forms;
using BM = ICSharpCode.SharpDevelop.Bookmarks;
namespace ICSharpCode.Core
{
@ -344,25 +345,6 @@ namespace ICSharpCode.Core @@ -344,25 +345,6 @@ namespace ICSharpCode.Core
}
}
public static void ToggleBreakpointAt(string fileName, int line, int column)
{
foreach(Breakpoint b in breakpoints) {
if (b.FileName == fileName && b.LineNumber == line) {
breakpoints.Remove(b);
OnBreakPointRemoved(EventArgs.Empty);
return;
}
}
breakpoints.Add(new Breakpoint(fileName, line));
OnBreakPointAdded(EventArgs.Empty);
}
class BreakpointMarker: TextMarker
{
public BreakpointMarker(int offset, int length, TextMarkerType textMarkerType, Color color, Color foreColor):base(offset, length, textMarkerType, color, foreColor)
@ -380,6 +362,28 @@ namespace ICSharpCode.Core @@ -380,6 +362,28 @@ namespace ICSharpCode.Core
public static void InitializeService2()
{
WorkbenchSingleton.WorkbenchCreated += new EventHandler(WorkspaceCreated);
BM.BookmarkManager.Added += BookmarkAdded;
BM.BookmarkManager.Removed += BookmarkRemoved;
}
static void BookmarkAdded(object sender, BM.BookmarkEventArgs e)
{
BreakpointBookmark bb = e.Bookmark as BreakpointBookmark;
if (bb != null) {
breakpoints.Add(bb.Breakpoint);
RefreshBreakpointMarkersInDocument(bb.Document);
OnBreakPointAdded(EventArgs.Empty);
}
}
static void BookmarkRemoved(object sender, BM.BookmarkEventArgs e)
{
BreakpointBookmark bb = e.Bookmark as BreakpointBookmark;
if (bb != null) {
breakpoints.Remove(bb.Breakpoint);
RefreshBreakpointMarkersInDocument(bb.Document);
OnBreakPointRemoved(EventArgs.Empty);
}
}
static void WorkspaceCreated(object sender, EventArgs args)
@ -397,7 +401,7 @@ namespace ICSharpCode.Core @@ -397,7 +401,7 @@ namespace ICSharpCode.Core
textArea.IconBarMargin.Painted += new MarginPaintEventHandler(PaintIconBar);
textArea.MouseMove += new MouseEventHandler(TextAreaMouseMove);
RefreshBreakpointMarkersInEditor(textArea.MotherTextEditorControl);
RefreshBreakpointMarkersInDocument(textArea.MotherTextEditorControl.Document);
}
}
@ -453,25 +457,35 @@ namespace ICSharpCode.Core @@ -453,25 +457,35 @@ namespace ICSharpCode.Core
}
}
static void IconBarMouseDown(AbstractMargin iconBar, Point mousepos, MouseButtons mouseButtons)
{
Rectangle viewRect = iconBar.TextArea.TextView.DrawingPosition;
Point logicPos = iconBar.TextArea.TextView.GetLogicalPosition(0, mousepos.Y - viewRect.Top);
if (logicPos.Y >= 0 && logicPos.Y < iconBar.TextArea.Document.TotalNumberOfLines) {
ToggleBreakpointAt(iconBar.TextArea.MotherTextEditorControl.FileName , logicPos.Y + 1, 0);
RefreshBreakpointMarkersInEditor(iconBar.TextArea.MotherTextEditorControl);
ToggleBreakpointAt(iconBar.TextArea.Document, iconBar.TextArea.MotherTextEditorControl.FileName, logicPos.Y + 1);
iconBar.TextArea.Refresh(iconBar);
}
}
static void ToggleBreakpointAt(IDocument document, string fileName, int lineNumber)
{
foreach (Bookmark m in document.BookmarkManager.Marks) {
BreakpointBookmark bb = m as BreakpointBookmark;
if (bb != null) {
if (bb.Breakpoint.LineNumber == lineNumber) {
document.BookmarkManager.RemoveMark(m);
return;
}
}
}
document.BookmarkManager.AddMark(new Breakpoint(document, fileName, lineNumber).Bookmark);
}
static void RefreshBreakpointMarkersInEditor(TextEditorControl textEditor)
static void RefreshBreakpointMarkersInDocument(IDocument document)
{
IDocument document = textEditor.Document;
System.Collections.Generic.List<ICSharpCode.TextEditor.Document.TextMarker> markers = textEditor.Document.MarkerStrategy.TextMarker;
if (document == null) return;
List<TextMarker> markers = document.MarkerStrategy.TextMarker;
// Remove all breakpoint markers
for (int i = 0; i < markers.Count;) {
if (markers[i] is BreakpointMarker) {
@ -481,10 +495,10 @@ namespace ICSharpCode.Core @@ -481,10 +495,10 @@ namespace ICSharpCode.Core
}
}
// Add breakpoint markers
foreach (Breakpoint b in Breakpoints) {
if (b.FileName.ToLower() == textEditor.FileName.ToLower()) {
LineSegment lineSeg = document.GetLineSegment((int)b.LineNumber - 1);
document.MarkerStrategy.TextMarker.Add(new BreakpointMarker(lineSeg.Offset, lineSeg.Length , TextMarkerType.SolidBlock, Color.Red, Color.White));
foreach (Bookmark b in document.BookmarkManager.Marks) {
if (b is BreakpointBookmark) {
LineSegment lineSeg = document.GetLineSegment(b.LineNumber);
document.MarkerStrategy.TextMarker.Add(new BreakpointMarker(lineSeg.Offset, lineSeg.Length, TextMarkerType.SolidBlock, Color.Red, Color.White));
}
}
// Perform editor update
@ -497,16 +511,6 @@ namespace ICSharpCode.Core @@ -497,16 +511,6 @@ namespace ICSharpCode.Core
/// </summary>
static void PaintIconBar(AbstractMargin iconBar, Graphics g, Rectangle rect)
{
foreach (Breakpoint breakpoint in Breakpoints) {
if (Path.GetFullPath(breakpoint.FileName) == Path.GetFullPath(iconBar.TextArea.MotherTextEditorControl.FileName)) {
int lineNumber = iconBar.TextArea.Document.GetVisibleLine((int)breakpoint.LineNumber - 1);
int yPos = (int)(lineNumber * iconBar.TextArea.TextView.FontHeight) - iconBar.TextArea.VirtualTop.Y;
if (yPos >= rect.Y && yPos <= rect.Bottom) {
((IconBarMargin)iconBar).DrawBreakpoint(g, yPos, breakpoint.IsEnabled);
}
}
}
foreach (TextMarker textMarker in iconBar.TextArea.Document.MarkerStrategy.TextMarker) {
CurrentLineMarker currentLineMarker = textMarker as CurrentLineMarker;
if (currentLineMarker != null) {
@ -556,11 +560,12 @@ namespace ICSharpCode.Core @@ -556,11 +560,12 @@ namespace ICSharpCode.Core
// otherwise textArea will close the tooltip.
} else {
// Look if it is variable
//value = selectedThread.LocalVariables[expresion].Value.ToString();
ResolveResult result = ParserService.Resolve(expression, logicPos.Y + 1, xPosition + 1, textArea.MotherTextEditorControl.FileName, textContent);
string value = GetText(result);
if (value != null) {
#if DEBUG
value = "expr: >" + expression + "<\n" + value;
#endif
textArea.SetToolTip(value);
}
oldToolTip = value;
@ -609,10 +614,9 @@ namespace ICSharpCode.Core @@ -609,10 +614,9 @@ namespace ICSharpCode.Core
} else if (result is TypeResolveResult) {
return GetText(ambience, ((TypeResolveResult)result).ResolvedClass);
} else {
if (result.ResolvedType == null)
// if (result.ResolvedType != null)
// return "expression of type " + ambience.Convert(result.ResolvedType);
return null;
else
return "expression of type " + ambience.Convert(result.ResolvedType);
}
}

60
src/Main/Base/Project/Src/TextEditor/Bookmarks/Bookmark.cs

@ -8,41 +8,21 @@ @@ -8,41 +8,21 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Windows.Forms;
using System.Drawing;
using System.CodeDom.Compiler;
using System.IO;
using System.Diagnostics;
using System.Text;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui.OptionPanels;
using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.DefaultEditor.Commands;
using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Document;
namespace Bookmark
namespace ICSharpCode.SharpDevelop.Bookmarks
{
/// <summary>
/// Description of Bookmark.
/// </summary>
public class Bookmark
public class SDBookmark : Bookmark
{
ICSharpCode.TextEditor.Document.Bookmark bookmark;
string fileName;
public ICSharpCode.TextEditor.Document.IDocument Document {
get {
return bookmark.Document;
}
}
public ICSharpCode.TextEditor.Document.Bookmark CreateBookmark(ICSharpCode.TextEditor.Document.IDocument document)
{
this.bookmark = new ICSharpCode.TextEditor.Document.Bookmark(document, LineNumber, IsEnabled);
return bookmark;
}
public string FileName {
get {
return fileName;
@ -52,25 +32,33 @@ namespace Bookmark @@ -52,25 +32,33 @@ namespace Bookmark
}
}
public int LineNumber {
get {
return bookmark.LineNumber;
public SDBookmark(string fileName, IDocument document, int lineNumber) : base(document, lineNumber)
{
this.fileName = fileName;
}
}
public bool IsEnabled {
get {
return bookmark.IsEnabled;
public class SDBookmarkFactory : IBookmarkFactory
{
string fileName;
ICSharpCode.TextEditor.Document.BookmarkManager manager;
public SDBookmarkFactory(ICSharpCode.TextEditor.Document.BookmarkManager manager)
{
this.manager = manager;
}
set {
bookmark.IsEnabled = value;
public void ChangeFilename(string newFileName)
{
fileName = newFileName;
foreach (SDBookmark mark in manager.Marks) {
mark.FileName = newFileName;
}
}
public Bookmark(string fileName, ICSharpCode.TextEditor.Document.Bookmark bookmark)
public Bookmark CreateBookmark(IDocument document, int lineNumber)
{
this.fileName = fileName;
this.bookmark = bookmark;
return new SDBookmark(fileName, document, lineNumber);
}
}
}

8
src/Main/Base/Project/Src/TextEditor/Bookmarks/BookmarkEventHandler.cs

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
using System;
namespace Bookmark
namespace ICSharpCode.SharpDevelop.Bookmarks
{
public delegate void BookmarkEventHandler(object sender, BookmarkEventArgs e);
@ -18,15 +18,15 @@ namespace Bookmark @@ -18,15 +18,15 @@ namespace Bookmark
/// </summary>
public class BookmarkEventArgs : EventArgs
{
Bookmark bookmark;
SDBookmark bookmark;
public Bookmark Bookmark {
public SDBookmark Bookmark {
get {
return bookmark;
}
}
public BookmarkEventArgs(Bookmark bookmark)
public BookmarkEventArgs(SDBookmark bookmark)
{
this.bookmark = bookmark;
}

34
src/Main/Base/Project/Src/TextEditor/Bookmarks/BookmarkManager.cs

@ -1,27 +1,29 @@ @@ -1,27 +1,29 @@
using System;
using System.Collections.Generic;
using ICSharpCode.Core;
using ICSharpCode.TextEditor.Document;
namespace Bookmark
namespace ICSharpCode.SharpDevelop.Bookmarks
{
/// <summary>
/// Description of BookmarkManager.
/// </summary>
public static class BookmarkManager
{
static List<Bookmark> bookmarks = new List<Bookmark>();
static List<SDBookmark> bookmarks = new List<SDBookmark>();
public static List<Bookmark> Bookmarks {
public static List<SDBookmark> Bookmarks {
get {
return bookmarks;
}
}
public static List<Bookmark> GetBookmarks(string fileName)
public static List<SDBookmark> GetBookmarks(string fileName)
{
List<Bookmark> marks = new List<Bookmark>();
List<SDBookmark> marks = new List<SDBookmark>();
foreach (Bookmark mark in bookmarks) {
foreach (SDBookmark mark in bookmarks) {
if (mark.FileName == null) continue;
if (FileUtility.IsEqualFile(mark.FileName, fileName)) {
marks.Add(mark);
}
@ -30,23 +32,17 @@ namespace Bookmark @@ -30,23 +32,17 @@ namespace Bookmark
return marks;
}
public static void AddMark(string fileName, ICSharpCode.TextEditor.Document.Bookmark bookmark)
public static void AddMark(SDBookmark bookmark)
{
Bookmark mark = new Bookmark(fileName, bookmark);
bookmarks.Add(mark);
OnAdded(new BookmarkEventArgs(mark));
if (bookmarks.Contains(bookmark)) return;
bookmarks.Add(bookmark);
OnAdded(new BookmarkEventArgs(bookmark));
}
public static void RemoveMark(string fileName, ICSharpCode.TextEditor.Document.Bookmark bookmark)
public static void RemoveMark(SDBookmark bookmark)
{
for (int i = 0; i < bookmarks.Count; ) {
if (FileUtility.IsEqualFile(bookmarks[i].FileName, fileName) && bookmarks[i].LineNumber == bookmark.LineNumber) {
OnRemoved(new BookmarkEventArgs(bookmarks[i]));
bookmarks.RemoveAt(i);
} else {
++i;
}
}
bookmarks.Remove(bookmark);
OnRemoved(new BookmarkEventArgs(bookmark));
}
static void OnRemoved(BookmarkEventArgs e)

2
src/Main/Base/Project/Src/TextEditor/Bookmarks/Commands/MenuCommands.cs

@ -25,7 +25,7 @@ using ICSharpCode.TextEditor; @@ -25,7 +25,7 @@ using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Actions;
using ICSharpCode.SharpDevelop.DefaultEditor.Commands;
namespace Bookmarks
namespace ICSharpCode.SharpDevelop.Bookmarks
{
public class ToggleBookmark : AbstractEditActionMenuCommand
{

10
src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPad.cs

@ -21,7 +21,7 @@ using ICSharpCode.SharpDevelop.Project; @@ -21,7 +21,7 @@ using ICSharpCode.SharpDevelop.Project;
using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.DefaultEditor.Commands;
namespace Bookmark
namespace ICSharpCode.SharpDevelop.Bookmarks
{
public class BookmarkPad : AbstractPadContent
{
@ -62,12 +62,12 @@ namespace Bookmark @@ -62,12 +62,12 @@ namespace Bookmark
BookmarkManager.Added += new BookmarkEventHandler(BookmarkManagerAdded);
BookmarkManager.Removed += new BookmarkEventHandler(BookmarkManagerRemoved);
foreach (Bookmark mark in BookmarkManager.Bookmarks) {
foreach (SDBookmark mark in BookmarkManager.Bookmarks) {
AddMark(mark);
}
}
void AddMark(Bookmark mark)
void AddMark(SDBookmark mark)
{
if (!fileNodes.ContainsKey(mark.FileName)) {
BookmarkFolderNode folderNode = new BookmarkFolderNode(mark.FileName);
@ -80,7 +80,7 @@ namespace Bookmark @@ -80,7 +80,7 @@ namespace Bookmark
void BookmarkManagerAdded(object sender, BookmarkEventArgs e)
{
AddMark(e.Bookmark);
AddMark((SDBookmark)e.Bookmark);
}
void BookmarkManagerRemoved(object sender, BookmarkEventArgs e)
@ -98,7 +98,7 @@ namespace Bookmark @@ -98,7 +98,7 @@ namespace Bookmark
{
TreeNode node = bookmarkTreeView.SelectedNode;
if (node != null) {
Bookmark mark = node.Tag as Bookmark;
SDBookmark mark = node.Tag as SDBookmark;
if (mark != null) {
FileService.JumpToFilePosition(mark.FileName, mark.LineNumber, 0);
}

2
src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/BookmarkPadToolbarCommands.cs

@ -22,7 +22,7 @@ using ICSharpCode.SharpDevelop.Gui; @@ -22,7 +22,7 @@ using ICSharpCode.SharpDevelop.Gui;
using ICSharpCode.SharpDevelop.DefaultEditor.Commands;
using ICSharpCode.SharpDevelop;
namespace Bookmark
namespace ICSharpCode.SharpDevelop.Bookmarks
{
public class GotoNext : AbstractMenuCommand
{

12
src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkFolderNode.cs

@ -6,19 +6,19 @@ using ICSharpCode.TextEditor.Document; @@ -6,19 +6,19 @@ using ICSharpCode.TextEditor.Document;
using ICSharpCode.Core;
using ICSharpCode.SharpDevelop.Gui;
namespace Bookmark
namespace ICSharpCode.SharpDevelop.Bookmarks
{
/// <summary>
/// Description of SearchFolderNode.
/// </summary>
public class BookmarkFolderNode : ExtFolderNode
{
List<Bookmark> marks = new List<Bookmark>();
List<SDBookmark> marks = new List<SDBookmark>();
string fileName;
string occurences;
Image icon;
public List<Bookmark> Marks {
public List<SDBookmark> Marks {
get {
return marks;
}
@ -64,7 +64,7 @@ namespace Bookmark @@ -64,7 +64,7 @@ namespace Bookmark
DrawText(g, occurences, Brushes.Gray, ItalicFont, ref x, e.Bounds.Y);
}
public void AddMark(Bookmark mark)
public void AddMark(SDBookmark mark)
{
marks.Add(mark);
@ -76,7 +76,7 @@ namespace Bookmark @@ -76,7 +76,7 @@ namespace Bookmark
SetText();
}
public void RemoveMark(Bookmark mark)
public void RemoveMark(SDBookmark mark)
{
marks.Remove(mark);
if (isInitialized) {
@ -98,7 +98,7 @@ namespace Bookmark @@ -98,7 +98,7 @@ namespace Bookmark
if (document.HighlightingStrategy == null) {
document.HighlightingStrategy = HighlightingStrategyFactory.CreateHighlightingStrategyForFile(fileName);
}
foreach (Bookmark mark in marks) {
foreach (SDBookmark mark in marks) {
TreeNode newResult = new BookmarkNode(mark);
Nodes.Add(newResult);
}

8
src/Main/Base/Project/Src/TextEditor/Bookmarks/Pad/Nodes/BookmarkNode.cs

@ -7,14 +7,14 @@ using ICSharpCode.TextEditor; @@ -7,14 +7,14 @@ using ICSharpCode.TextEditor;
using ICSharpCode.TextEditor.Document;
using ICSharpCode.SharpDevelop.Gui;
namespace Bookmark
namespace ICSharpCode.SharpDevelop.Bookmarks
{
/// <summary>
/// Description of SearchFolderNode.
/// </summary>
public class BookmarkNode : ExtTreeNode
{
Bookmark bookmark;
SDBookmark bookmark;
SizeF spaceSize;
static StringFormat sf = (StringFormat)System.Drawing.StringFormat.GenericTypographic.Clone();
@ -23,13 +23,13 @@ namespace Bookmark @@ -23,13 +23,13 @@ namespace Bookmark
string positionText;
public Bookmark Bookmark {
public SDBookmark Bookmark {
get {
return bookmark;
}
}
public BookmarkNode(Bookmark bookmark)
public BookmarkNode(SDBookmark bookmark)
{
drawDefault = false;
this.bookmark = bookmark;

44
src/Main/Base/Project/Src/TextEditor/Gui/Editor/SharpDevelopTextAreaControl.cs

@ -45,6 +45,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -45,6 +45,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
{
errorDrawer = new ErrorDrawer(this);
Document.FoldingManager.FoldingStrategy = new ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ParserFoldingStrategy();
Document.BookmarkManager.Factory = new Bookmarks.SDBookmarkFactory(Document.BookmarkManager);
Document.BookmarkManager.Added += new BookmarkEventHandler(BookmarkAdded);
Document.BookmarkManager.Removed += new BookmarkEventHandler(BookmarkRemoved);
GenerateEditActions();
@ -55,16 +56,12 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -55,16 +56,12 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
void BookmarkAdded(object sender, BookmarkEventArgs e)
{
if (FileName != null) {
Bookmark.BookmarkManager.AddMark(FileName, e.Bookmark);
}
Bookmarks.BookmarkManager.AddMark((Bookmarks.SDBookmark)e.Bookmark);
}
void BookmarkRemoved(object sender, BookmarkEventArgs e)
{
if (FileName != null) {
Bookmark.BookmarkManager.RemoveMark(FileName, e.Bookmark);
}
Bookmarks.BookmarkManager.RemoveMark((Bookmarks.SDBookmark)e.Bookmark);
}
public virtual ICompletionDataProvider CreateCodeCompletionDataProvider(bool ctrlSpace)
@ -88,15 +85,17 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -88,15 +85,17 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
newControl.MouseWheel += new MouseEventHandler(TextAreaMouseWheel);
newControl.DoHandleMousewheel = false;
}
protected override void Dispose(bool disposing)
{
base.Dispose(Disposing);
base.Dispose(disposing);
if (disposing) {
errorDrawer.Dispose();
CloseCodeCompletionWindow(this, EventArgs.Empty);
CloseInsightWindow(this, EventArgs.Empty);
}
}
void CloseCodeCompletionWindow(object sender, EventArgs e)
{
if (codeCompletionWindow != null) {
@ -145,36 +144,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -145,36 +144,6 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
}
}
// void IconBarMouseDown(AbstractMargin iconBar, Point mousepos, MouseButtons mouseButtons)
// {
// int realline = iconBar.TextArea.TextView.GetLogicalLine(mousepos);
// if (realline >= 0 && realline < iconBar.TextArea.Document.TotalNumberOfLines) {
//
// if (DebuggerService.CurrentDebugger.SupportsExecutionControl) {
// DebuggerService.ToggleBreakpointAt(FileName, realline + 1, 0);
// iconBar.TextArea.Refresh(iconBar);
// }
// }
// }
//
// void PaintIconBarBreakPoints(AbstractMargin iconBar, Graphics g, Rectangle rect)
// {
//
// lock (DebuggerService.Breakpoints) {
// foreach (Breakpoint breakpoint in DebuggerService.Breakpoints) {
// try {
// if (Path.GetFullPath(breakpoint.FileName) == Path.GetFullPath(FileName)) {
// int lineNumber = iconBar.TextArea.Document.GetVisibleLine(breakpoint.LineNumber - 1);
// int yPos = (int)(lineNumber * iconBar.TextArea.TextView.FontHeight) - iconBar.TextArea.VirtualTop.Y;
// if (yPos >= rect.Y && yPos <= rect.Bottom) {
// ((IconBarMargin)iconBar).DrawBreakpoint(g, yPos, breakpoint.IsEnabled);
// }
// }
// } catch (Exception) {}
// }
// }
// }
void CaretPositionChanged(object sender, EventArgs e)
{
StatusBarService.SetCaretPosition(ActiveTextAreaControl.TextArea.TextView.GetVisualColumn(ActiveTextAreaControl.Caret.Line, ActiveTextAreaControl.Caret.Column), ActiveTextAreaControl.Caret.Line, ActiveTextAreaControl.Caret.Column);
@ -229,6 +198,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -229,6 +198,7 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
protected override void OnFileNameChanged(EventArgs e)
{
base.OnFileNameChanged(e);
((Bookmarks.SDBookmarkFactory)Document.BookmarkManager.Factory).ChangeFilename(this.FileName);
ActivateQuickClassBrowserOnDemand();
}

6
src/Main/Base/Project/Src/TextEditor/Gui/Editor/TextEditorDisplayBinding.cs

@ -322,10 +322,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor @@ -322,10 +322,10 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor
TitleName = Path.GetFileName(fileName);
IsDirty = false;
SetWatcher();
foreach (Bookmark.Bookmark mark in Bookmark.BookmarkManager.GetBookmarks(fileName)) {
textAreaControl.Document.BookmarkManager.Marks.Add(mark.CreateBookmark(textAreaControl.Document));
foreach (Bookmarks.SDBookmark mark in Bookmarks.BookmarkManager.GetBookmarks(fileName)) {
mark.Document = textAreaControl.Document;
textAreaControl.Document.BookmarkManager.Marks.Add(mark);
}
}
public Properties CreateMemento()

Loading…
Cancel
Save