Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@753 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
17 changed files with 235 additions and 351 deletions
@ -0,0 +1,114 @@
@@ -0,0 +1,114 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Drawing; |
||||
using System.Windows.Forms; |
||||
|
||||
using Debugger; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
public class TreeListViewDebuggerItem: TreeListViewItem |
||||
{ |
||||
Variable variable; |
||||
bool created; |
||||
|
||||
public Variable Variable { |
||||
get { |
||||
return variable; |
||||
} |
||||
} |
||||
|
||||
public bool Highlight { |
||||
set { |
||||
if (value) { |
||||
if (SubItems[1].ForeColor != Color.Blue) { // smart update
|
||||
SubItems[1].ForeColor = Color.Blue; |
||||
SubItems[1].Font = new Font(SubItems[1].Font, FontStyle.Bold); |
||||
} |
||||
} else { |
||||
if (SubItems[1].ForeColor != Color.Black) { // smart update
|
||||
SubItems[1].ForeColor = Color.Black; |
||||
SubItems[1].Font = new Font(SubItems[1].Font, FontStyle.Regular); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
public TreeListViewDebuggerItem(Variable variable) |
||||
{ |
||||
this.variable = variable; |
||||
variable.ValueChanged += delegate { Update(); }; |
||||
|
||||
SubItems.Add(""); |
||||
SubItems.Add(""); |
||||
|
||||
Update(); |
||||
|
||||
created = true; // Used to prevent highlighting of new variables
|
||||
} |
||||
|
||||
public void Update() |
||||
{ |
||||
Highlight = (Variable.Value.AsString != SubItems[1].Text && created); |
||||
|
||||
this.SubItems[0].Text = Variable.Name; |
||||
this.SubItems[1].Text = Variable.Value.AsString; |
||||
this.SubItems[2].Text = Variable.Value.Type; |
||||
|
||||
if (variable.Value is ObjectValue) { |
||||
this.ImageIndex = 0; // Class
|
||||
} else if (variable is PropertyVariable){ |
||||
this.ImageIndex = 2; // Property
|
||||
} else { |
||||
this.ImageIndex = 1; // Field
|
||||
} |
||||
|
||||
// if (IsExpanded) {
|
||||
// UpdateSubVariables();
|
||||
// } else {
|
||||
// if (variable.Value.MayHaveSubVariables) {
|
||||
// Items.Add(new PlaceHolderItem()); // Show plus icon
|
||||
// }
|
||||
// }
|
||||
} |
||||
|
||||
public void BeforeExpand() |
||||
{ |
||||
|
||||
} |
||||
|
||||
// public GetBaseClass()
|
||||
// {
|
||||
// ObjectValue objectValue = uncastedVariable.Value as ObjectValue;
|
||||
// if (objectValue != null && objectValue.HasBaseClass && objectValue.BaseClass.Type != "System.Object") {
|
||||
// this.Variable = VariableFactory.CreateVariable(objectValue.BaseClass, uncastedVariable.Name);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// protected void UpdateSubVariables() {
|
||||
// if (!baseClassItemAdded) {
|
||||
// VariableListItem baseClassItem = new BaseClassItem(variable);
|
||||
// if (baseClassItem.IsValid) {
|
||||
// this.Items.Add(baseClassItem);
|
||||
// }
|
||||
// baseClassItemAdded = true;
|
||||
// }
|
||||
//
|
||||
// // Do not sort names of array items
|
||||
// if (Variable.Value is ArrayValue) {
|
||||
// this.Items.SortOrder = SortOrder.None;
|
||||
// } else {
|
||||
// this.Items.SortOrder = SortOrder.Ascending;
|
||||
// }
|
||||
//
|
||||
// LocalVarPad.UpdateVariables(this.Items, Variable.Value.SubVariables);
|
||||
// }
|
||||
|
||||
} |
||||
} |
@ -1,49 +0,0 @@
@@ -1,49 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using Debugger; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
class BaseClassItem: VariableItem |
||||
{ |
||||
public BaseClassItem(Variable uncastedVariable) |
||||
{ |
||||
ObjectValue objectValue = uncastedVariable.Value as ObjectValue; |
||||
if (objectValue != null && objectValue.HasBaseClass && objectValue.BaseClass.Type != "System.Object") { |
||||
this.Variable = VariableFactory.CreateVariable(objectValue.BaseClass, uncastedVariable.Name); |
||||
} else { |
||||
this.Variable = null; |
||||
} |
||||
Refresh(); |
||||
} |
||||
|
||||
public override void Refresh() |
||||
{ |
||||
if (!IsValid) { |
||||
return; |
||||
} |
||||
|
||||
SetTexts("<Base class>", |
||||
Variable.Value.AsString.ToString(), |
||||
Variable.Value.Type); |
||||
|
||||
ImageIndex = 0; // Class
|
||||
|
||||
if (IsExpanded) { |
||||
UpdateSubVariables(); |
||||
} else { |
||||
if (Variable.Value.MayHaveSubVariables) { // Always true
|
||||
Items.Add(new PlaceHolderItem()); // Show plus icon
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,22 +0,0 @@
@@ -1,22 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
class PlaceHolderItem: VariableListItem |
||||
{ |
||||
public override bool IsValid { |
||||
get { |
||||
return false; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,100 +0,0 @@
@@ -1,100 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows.Forms; |
||||
using Debugger; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
class VariableItem: VariableListItem |
||||
{ |
||||
Variable variable; |
||||
|
||||
bool baseClassItemAdded = false; |
||||
|
||||
public Variable Variable { |
||||
get { |
||||
return variable; |
||||
} |
||||
set { |
||||
variable = value; |
||||
} |
||||
} |
||||
|
||||
public override bool IsValid { |
||||
get { |
||||
return variable != null && |
||||
!variable.Name.StartsWith("CS$"); |
||||
} |
||||
} |
||||
|
||||
protected VariableItem() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public VariableItem(Variable variable): base() |
||||
{ |
||||
this.variable = variable; |
||||
Refresh(); |
||||
} |
||||
|
||||
public override void PrepareForExpansion() |
||||
{ |
||||
UpdateSubVariables(); |
||||
} |
||||
|
||||
public override void Refresh() |
||||
{ |
||||
if (!IsValid) { |
||||
return; |
||||
} |
||||
|
||||
SetTexts(variable.Name, |
||||
variable.Value.AsString, |
||||
variable.Value.Type); |
||||
|
||||
if (variable.Value is ObjectValue) { |
||||
ImageIndex = 0; // Class
|
||||
} else if (variable is PropertyVariable){ |
||||
ImageIndex = 2; // Property
|
||||
} else { |
||||
ImageIndex = 1; // Field
|
||||
} |
||||
|
||||
if (IsExpanded) { |
||||
UpdateSubVariables(); |
||||
} else { |
||||
if (variable.Value.MayHaveSubVariables) { |
||||
Items.Add(new PlaceHolderItem()); // Show plus icon
|
||||
} |
||||
} |
||||
} |
||||
|
||||
protected void UpdateSubVariables() { |
||||
if (!baseClassItemAdded) { |
||||
VariableListItem baseClassItem = new BaseClassItem(variable); |
||||
if (baseClassItem.IsValid) { |
||||
this.Items.Add(baseClassItem); |
||||
} |
||||
baseClassItemAdded = true; |
||||
} |
||||
|
||||
// Do not sort names of array items
|
||||
if (Variable.Value is ArrayValue) { |
||||
this.Items.SortOrder = SortOrder.None; |
||||
} else { |
||||
this.Items.SortOrder = SortOrder.Ascending; |
||||
} |
||||
|
||||
LocalVarPad.UpdateVariables(this.Items, Variable.Value.SubVariables); |
||||
} |
||||
} |
||||
} |
@ -1,76 +0,0 @@
@@ -1,76 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Text; |
||||
using System.Windows.Forms; |
||||
using System.Drawing; |
||||
|
||||
namespace ICSharpCode.SharpDevelop.Gui.Pads |
||||
{ |
||||
abstract class VariableListItem: TreeListViewItem |
||||
{ |
||||
bool textsInitialized; |
||||
|
||||
public abstract bool IsValid { |
||||
get; |
||||
} |
||||
|
||||
public VariableListItem() |
||||
{ |
||||
Reset(); |
||||
} |
||||
|
||||
public virtual void PrepareForExpansion() |
||||
{ |
||||
|
||||
} |
||||
|
||||
public virtual void Reset() |
||||
{ |
||||
SubItems.Clear(); |
||||
Text = ""; |
||||
SubItems.Add(""); |
||||
SubItems.Add(""); |
||||
} |
||||
|
||||
public virtual void Refresh() |
||||
{ |
||||
|
||||
} |
||||
|
||||
protected void SetTexts(string name, string value, string type) |
||||
{ |
||||
if (value == SubItems[1].Text || !textsInitialized) { |
||||
// Value has not changed since last setting
|
||||
if (SubItems[1].ForeColor != Color.Black) { |
||||
SubItems[1].ForeColor = Color.Black; |
||||
SubItems[1].Font = new Font(SubItems[1].Font, FontStyle.Regular); |
||||
} |
||||
} else { |
||||
// Value has changed since last setting
|
||||
if (SubItems[1].ForeColor != Color.Blue) { |
||||
SubItems[1].ForeColor = Color.Blue; |
||||
SubItems[1].Font = new Font(SubItems[1].Font, FontStyle.Bold); |
||||
} |
||||
} |
||||
|
||||
if (SubItems[0].Text != name) { |
||||
SubItems[0].Text = name; |
||||
} |
||||
if (SubItems[1].Text != value) { |
||||
SubItems[1].Text = value; |
||||
} |
||||
if (SubItems[2].Text != type) { |
||||
SubItems[2].Text = type; |
||||
} |
||||
|
||||
textsInitialized = true; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt">2002-2005 AlphaSierraPapa</copyright>
|
||||
// <license see="prj:///doc/license.txt">GNU General Public License</license>
|
||||
// <owner name="David Srbecký" email="dsrbecky@gmail.com"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace Debugger |
||||
{ |
||||
[Serializable] |
||||
public class VariableCollectionEventArgs: DebuggerEventArgs |
||||
{ |
||||
VariableCollection variableCollection; |
||||
|
||||
public VariableCollection VariableCollection { |
||||
get { |
||||
return variableCollection; |
||||
} |
||||
} |
||||
|
||||
public VariableCollectionEventArgs(VariableCollection variableCollection): base(variableCollection.Debugger) |
||||
{ |
||||
this.variableCollection = variableCollection; |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue