Browse Source

Private and static members placed into own sub-menu in Local Variables Pad

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1401 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
1fa4e43c14
  1. 49
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs

49
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/LocalVarPad.cs

@ -90,11 +90,56 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -90,11 +90,56 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
AddVariableToTree(e.Variable, tree);
};
List<Variable> publicStatic = new List<Variable>();
List<Variable> publicInstance = new List<Variable>();
List<Variable> privateStatic = new List<Variable>();
List<Variable> privateInstance = new List<Variable>();
foreach(Variable variable in varCollection) {
ClassVariable classVariable = variable as ClassVariable;
if (classVariable == null) {
publicInstance.Add(variable);
} else {
if (classVariable.IsPublic) {
if (classVariable.IsStatic) {
publicStatic.Add(variable);
} else {
publicInstance.Add(variable);
}
} else {
if (classVariable.IsStatic) {
privateStatic.Add(variable);
} else {
privateInstance.Add(variable);
}
}
}
}
if (privateInstance.Count > 0) {
AddMenu("<Private Members>", privateInstance, tree);
}
if (publicStatic.Count > 0) {
AddMenu("<Public Static Members>", publicStatic, tree);
}
if (privateStatic.Count > 0) {
AddMenu("<Private Static Members>", privateStatic, tree);
}
// Public Members
foreach(Variable variable in publicInstance) {
AddVariableToTree(variable, tree);
}
}
public static void AddMenu(string name, List<Variable> variables, TreeListViewItemCollection tree)
{
TreeListViewItem menu = new TreeListViewItem(name, 0);
tree.Add(menu);
foreach(Variable variable in variables) {
AddVariableToTree(variable, menu.Items);
}
}
public static void AddVariableToTree(Variable variableToAdd, TreeListViewItemCollection tree)
{
TreeListViewDebuggerItem newItem = new TreeListViewDebuggerItem(variableToAdd);
@ -105,7 +150,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -105,7 +150,9 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
private void localVarList_BeforeExpand(object sender, TreeListViewCancelEventArgs e)
{
if (debuggerCore.IsPaused) {
((TreeListViewDebuggerItem)e.Item).BeforeExpand();
if (e.Item is TreeListViewDebuggerItem) {
((TreeListViewDebuggerItem)e.Item).BeforeExpand();
}
} else {
MessageBox.Show("You can not explore variables while the debuggee is running.");
e.Cancel = true;

Loading…
Cancel
Save