Browse Source

Hack for variables that change type (Forum-7347)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1384 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 19 years ago
parent
commit
765a5aa0b3
  1. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ClassVariable.cs
  2. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Variable.cs
  3. 11
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs

4
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/ClassVariable.cs

@ -11,8 +11,8 @@ namespace Debugger @@ -11,8 +11,8 @@ namespace Debugger
{
public class ClassVariable: Variable
{
bool isStatic;
bool isPublic;
internal bool isStatic;
internal bool isPublic;
public bool IsStatic {
get {

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Variable.cs

@ -23,8 +23,8 @@ namespace Debugger @@ -23,8 +23,8 @@ namespace Debugger
string name;
VariableCollection subVariables;
protected ValueGetter valueGetter;
Value cachedValue;
internal protected ValueGetter valueGetter;
internal Value cachedValue;
event EventHandler<DebuggerEventArgs> valueChanged;
public event EventHandler<VariableCollectionEventArgs> ValueRemovedFromCollection;
@ -89,7 +89,7 @@ namespace Debugger @@ -89,7 +89,7 @@ namespace Debugger
}
}
protected virtual void OnValueChanged()
protected internal virtual void OnValueChanged()
{
cachedValue = null;
if (valueChanged != null) {

11
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs

@ -144,6 +144,17 @@ namespace Debugger @@ -144,6 +144,17 @@ namespace Debugger
foreach(Variable newVariable in newVariables) {
if (this.Contains(newVariable.Name)) {
Variable oldVariable = this[newVariable.Name];
// HACK: Realy bad object-oriented design!!!
// Trasfer the new variable into the old one
if (oldVariable != newVariable) {
oldVariable.valueGetter = newVariable.valueGetter;
oldVariable.cachedValue = null;
if (newVariable is ClassVariable && oldVariable is ClassVariable) {
((ClassVariable)oldVariable).isPublic = ((ClassVariable)oldVariable).isPublic;
((ClassVariable)oldVariable).isStatic = ((ClassVariable)oldVariable).isStatic;
}
}
// Keep the variable in the list
toBeRemoved.Remove(this[newVariable.Name]);
} else {

Loading…
Cancel
Save