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