21 changed files with 660 additions and 306 deletions
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 733 B |
@ -0,0 +1,92 @@
@@ -0,0 +1,92 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
||||
|
||||
using System; |
||||
using System.Windows.Controls; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
public sealed class ShowZoomControlCommand : AbstractCheckableMenuCommand |
||||
{ |
||||
ParallelStackPad pad; |
||||
|
||||
public override object Owner { |
||||
get { return base.Owner; } |
||||
set { |
||||
if (!(value is ParallelStackPad)) |
||||
throw new Exception("Owner has to be a AbstractConsolePad"); |
||||
pad = value as ParallelStackPad; |
||||
base.Owner = value; |
||||
} |
||||
} |
||||
|
||||
public override bool IsChecked { |
||||
get { return pad.IsZoomControlVisible; } |
||||
set { pad.IsZoomControlVisible = value; } |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
IsChecked = !IsChecked; |
||||
} |
||||
} |
||||
|
||||
public sealed class ToggleMethodViewCommand : AbstractCheckableMenuCommand |
||||
{ |
||||
ParallelStackPad pad; |
||||
|
||||
public override object Owner { |
||||
get { return base.Owner; } |
||||
set { |
||||
if (!(value is ParallelStackPad)) |
||||
throw new Exception("Owner has to be a AbstractConsolePad"); |
||||
pad = value as ParallelStackPad; |
||||
base.Owner = value; |
||||
} |
||||
} |
||||
|
||||
public override bool IsChecked { |
||||
get { return pad.IsMethodView; } |
||||
set { pad.IsMethodView = value; } |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
IsChecked = !IsChecked; |
||||
} |
||||
} |
||||
|
||||
public sealed class ParallelStacksViewCommand : AbstractComboBoxCommand |
||||
{ |
||||
ParallelStackPad pad; |
||||
ComboBox box; |
||||
|
||||
protected override void OnOwnerChanged(EventArgs e) |
||||
{ |
||||
this.pad = this.Owner as ParallelStackPad; |
||||
if (this.pad == null) |
||||
return; |
||||
|
||||
box = this.ComboBox as ComboBox; |
||||
|
||||
if (this.box == null) |
||||
return; |
||||
|
||||
foreach (var name in Enum.GetNames(typeof(ParallelStacksView))) |
||||
box.Items.Add(name); |
||||
|
||||
box.SelectedIndex = 0; |
||||
|
||||
base.OnOwnerChanged(e); |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
if (this.pad != null && this.box != null) { |
||||
pad.ParallelStacksView = (ParallelStacksView)Enum.Parse(typeof(ParallelStacksView), box.SelectedValue.ToString()); |
||||
} |
||||
base.Run(); |
||||
} |
||||
} |
||||
} |
@ -1,47 +1,47 @@
@@ -1,47 +1,47 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
|
||||
|
||||
using System; |
||||
using Debugger; |
||||
using Debugger.AddIn; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.NRefactory; |
||||
using ICSharpCode.SharpDevelop.Debugging; |
||||
using ICSharpCode.SharpDevelop.Services; |
||||
using System.Windows.Controls; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
class SelectLanguageCommand : AbstractComboBoxCommand |
||||
{ |
||||
ConsolePad pad; |
||||
ComboBox box; |
||||
|
||||
protected override void OnOwnerChanged(EventArgs e) |
||||
{ |
||||
this.pad = this.Owner as ConsolePad; |
||||
if (this.pad == null) |
||||
return; |
||||
|
||||
box = this.ComboBox as ComboBox; |
||||
|
||||
if (this.box == null) |
||||
return; |
||||
|
||||
foreach (var name in Enum.GetNames(typeof(SupportedLanguage))) |
||||
box.Items.Add(name); |
||||
|
||||
box.SelectedIndex = 0; |
||||
|
||||
base.OnOwnerChanged(e); |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
if (this.pad != null && this.box != null) { |
||||
pad.SelectedLanguage = (SupportedLanguage)Enum.Parse(typeof(SupportedLanguage), box.SelectedValue.ToString()); |
||||
} |
||||
base.Run(); |
||||
} |
||||
} |
||||
} |
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
|
||||
|
||||
using System; |
||||
using Debugger; |
||||
using Debugger.AddIn; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.NRefactory; |
||||
using ICSharpCode.SharpDevelop.Debugging; |
||||
using ICSharpCode.SharpDevelop.Services; |
||||
using System.Windows.Controls; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
class SelectLanguageCommand : AbstractComboBoxCommand |
||||
{ |
||||
ConsolePad pad; |
||||
ComboBox box; |
||||
|
||||
protected override void OnOwnerChanged(EventArgs e) |
||||
{ |
||||
this.pad = this.Owner as ConsolePad; |
||||
if (this.pad == null) |
||||
return; |
||||
|
||||
box = this.ComboBox as ComboBox; |
||||
|
||||
if (this.box == null) |
||||
return; |
||||
|
||||
foreach (var name in Enum.GetNames(typeof(SupportedLanguage))) |
||||
box.Items.Add(name); |
||||
|
||||
box.SelectedIndex = 0; |
||||
|
||||
base.OnOwnerChanged(e); |
||||
} |
||||
|
||||
public override void Run() |
||||
{ |
||||
if (this.pad != null && this.box != null) { |
||||
pad.SelectedLanguage = (SupportedLanguage)Enum.Parse(typeof(SupportedLanguage), box.SelectedValue.ToString()); |
||||
} |
||||
base.Run(); |
||||
} |
||||
} |
||||
} |
@ -1,41 +1,66 @@
@@ -1,41 +1,66 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
|
||||
|
||||
using Debugger; |
||||
using ICSharpCode.SharpDevelop.Debugging; |
||||
using ICSharpCode.SharpDevelop.Services; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
public abstract class DebuggerPad: AbstractPadContent |
||||
{ |
||||
protected WindowsDebugger debugger; |
||||
|
||||
public DebuggerPad() |
||||
{ |
||||
debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; |
||||
|
||||
InitializeComponents(); |
||||
|
||||
debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) { |
||||
SelectProcess(e.Process); |
||||
}; |
||||
SelectProcess(debugger.DebuggedProcess); |
||||
} |
||||
|
||||
protected virtual void InitializeComponents() |
||||
{ |
||||
|
||||
} |
||||
|
||||
protected virtual void SelectProcess(Process process) |
||||
{ |
||||
|
||||
} |
||||
|
||||
public virtual void RefreshPad() |
||||
{ |
||||
|
||||
} |
||||
} |
||||
} |
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
|
||||
|
||||
using System.Windows.Controls; |
||||
using Debugger; |
||||
using ICSharpCode.SharpDevelop.Debugging; |
||||
using ICSharpCode.SharpDevelop.Services; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
public abstract class DebuggerPad : AbstractPadContent |
||||
{ |
||||
protected DockPanel panel; |
||||
ToolBar toolbar; |
||||
protected WindowsDebugger debugger; |
||||
|
||||
public override object Control { |
||||
get { |
||||
return panel; |
||||
} |
||||
} |
||||
|
||||
public DebuggerPad() |
||||
{ |
||||
// UI
|
||||
this.panel = new DockPanel(); |
||||
this.toolbar = BuildToolBar(); |
||||
|
||||
if (this.toolbar != null) { |
||||
this.toolbar.SetValue(DockPanel.DockProperty, Dock.Top); |
||||
|
||||
this.panel.Children.Add(toolbar); |
||||
} |
||||
|
||||
// logic
|
||||
debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; |
||||
|
||||
InitializeComponents(); |
||||
|
||||
debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) { |
||||
SelectProcess(e.Process); |
||||
}; |
||||
SelectProcess(debugger.DebuggedProcess); |
||||
} |
||||
|
||||
protected virtual void InitializeComponents() |
||||
{ |
||||
|
||||
} |
||||
|
||||
protected virtual void SelectProcess(Process process) |
||||
{ |
||||
|
||||
} |
||||
|
||||
public virtual void RefreshPad() |
||||
{ |
||||
|
||||
} |
||||
|
||||
protected virtual ToolBar BuildToolBar() |
||||
{ |
||||
return null; |
||||
} |
||||
} |
||||
} |
||||
|
@ -1,76 +1,72 @@
@@ -1,76 +1,72 @@
|
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Windows; |
||||
using Debugger; |
||||
using Debugger.AddIn.Visualizers.Graph; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ObjectGraphPad.
|
||||
/// </summary>
|
||||
public class ObjectGraphPad : DebuggerPad |
||||
{ |
||||
Process debuggedProcess; |
||||
ObjectGraphControl objectGraphControl; |
||||
static ObjectGraphPad instance; |
||||
|
||||
public ObjectGraphPad() |
||||
{ |
||||
instance = this; |
||||
} |
||||
|
||||
/// <remarks>Always check if Instance is null, might be null if pad is not opened!</remarks>
|
||||
public static ObjectGraphPad Instance { |
||||
get { return instance; } |
||||
} |
||||
|
||||
protected override void InitializeComponents() |
||||
{ |
||||
objectGraphControl = new ObjectGraphControl(); |
||||
} |
||||
|
||||
public override object Control { |
||||
get { |
||||
return objectGraphControl; |
||||
} |
||||
} |
||||
|
||||
public override void RefreshPad() |
||||
{ |
||||
// BUG: if pad window is undocked and floats standalone, IsVisible == false (so pad won't refresh)
|
||||
// REQUEST: need to refresh when pad becomes visible -> VisibleChanged event?
|
||||
if (!objectGraphControl.IsVisible) |
||||
{ |
||||
return; |
||||
} |
||||
if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) { |
||||
this.objectGraphControl.Clear(); |
||||
return; |
||||
} |
||||
this.objectGraphControl.Refresh(); |
||||
} |
||||
|
||||
protected override void SelectProcess(Process process) |
||||
{ |
||||
if (debuggedProcess != null) { |
||||
debuggedProcess.Paused -= debuggedProcess_Paused; |
||||
} |
||||
debuggedProcess = process; |
||||
if (debuggedProcess != null) { |
||||
debuggedProcess.Paused += debuggedProcess_Paused; |
||||
} |
||||
RefreshPad(); |
||||
} |
||||
|
||||
void debuggedProcess_Paused(object sender, ProcessEventArgs e) |
||||
{ |
||||
RefreshPad(); |
||||
} |
||||
} |
||||
} |
||||
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
|
||||
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
|
||||
|
||||
using ICSharpCode.Core; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Windows; |
||||
using Debugger; |
||||
using Debugger.AddIn.Visualizers.Graph; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
/// <summary>
|
||||
/// Description of ObjectGraphPad.
|
||||
/// </summary>
|
||||
public class ObjectGraphPad : DebuggerPad |
||||
{ |
||||
Process debuggedProcess; |
||||
ObjectGraphControl objectGraphControl; |
||||
static ObjectGraphPad instance; |
||||
|
||||
public ObjectGraphPad() |
||||
{ |
||||
instance = this; |
||||
} |
||||
|
||||
/// <remarks>Always check if Instance is null, might be null if pad is not opened!</remarks>
|
||||
public static ObjectGraphPad Instance { |
||||
get { return instance; } |
||||
} |
||||
|
||||
protected override void InitializeComponents() |
||||
{ |
||||
objectGraphControl = new ObjectGraphControl(); |
||||
panel.Children.Add(objectGraphControl); |
||||
} |
||||
|
||||
|
||||
public override void RefreshPad() |
||||
{ |
||||
// BUG: if pad window is undocked and floats standalone, IsVisible == false (so pad won't refresh)
|
||||
// REQUEST: need to refresh when pad becomes visible -> VisibleChanged event?
|
||||
if (!objectGraphControl.IsVisible) |
||||
{ |
||||
return; |
||||
} |
||||
if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) { |
||||
this.objectGraphControl.Clear(); |
||||
return; |
||||
} |
||||
this.objectGraphControl.Refresh(); |
||||
} |
||||
|
||||
protected override void SelectProcess(Process process) |
||||
{ |
||||
if (debuggedProcess != null) { |
||||
debuggedProcess.Paused -= debuggedProcess_Paused; |
||||
} |
||||
debuggedProcess = process; |
||||
if (debuggedProcess != null) { |
||||
debuggedProcess.Paused += debuggedProcess_Paused; |
||||
} |
||||
RefreshPad(); |
||||
} |
||||
|
||||
void debuggedProcess_Paused(object sender, ProcessEventArgs e) |
||||
{ |
||||
RefreshPad(); |
||||
} |
||||
} |
||||
} |
||||
|
Binary file not shown.
Loading…
Reference in new issue