1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the BSD license (for details please see \src\AddIns\Debugger\Debugger.AddIn\license.txt)
4
using ICSharpCode.Core;
6
using System.Collections.Generic;
10
using Debugger.AddIn.Visualizers.Graph;
12
namespace ICSharpCode.SharpDevelop.Gui.Pads
15
/// Description of ObjectGraphPad.
17
public class ObjectGraphPad : DebuggerPad
19
Process debuggedProcess;
20
ObjectGraphControl objectGraphControl;
21
static ObjectGraphPad instance;
23
public ObjectGraphPad()
28
/// <remarks>Always check if Instance is null, might be null if pad is not opened!</remarks>
29
public static ObjectGraphPad Instance {
30
get { return instance; }
33
protected override void InitializeComponents()
35
objectGraphControl = new ObjectGraphControl();
36
panel.Children.Add(objectGraphControl);
40
public override void RefreshPad()
42
// BUG: if pad window is undocked and floats standalone, IsVisible == false (so pad won't refresh)
43
// REQUEST: need to refresh when pad becomes visible -> VisibleChanged event?
44
if (!objectGraphControl.IsVisible)
48
if (debuggedProcess == null || debuggedProcess.IsRunning || debuggedProcess.SelectedStackFrame == null) {
49
this.objectGraphControl.Clear();
52
this.objectGraphControl.Refresh();
55
protected override void SelectProcess(Process process)
57
if (debuggedProcess != null) {
58
debuggedProcess.Paused -= debuggedProcess_Paused;
60
debuggedProcess = process;
61
if (debuggedProcess != null) {
62
debuggedProcess.Paused += debuggedProcess_Paused;
67
void debuggedProcess_Paused(object sender, ProcessEventArgs e)