Browse Source

Added VariableCollection.UpdateTo

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@740 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
31eac65e8a
  1. 7
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs
  2. 22
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/VariableCollection.cs

7
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

@ -25,6 +25,8 @@ namespace Debugger @@ -25,6 +25,8 @@ namespace Debugger
ApartmentState requiredApartmentState;
VariableCollection localVariables = new VariableCollection();
public ApartmentState RequiredApartmentState {
get {
return requiredApartmentState;
@ -177,10 +179,11 @@ namespace Debugger @@ -177,10 +179,11 @@ namespace Debugger
public VariableCollection LocalVariables {
get {
if (CurrentFunction == null) {
return VariableCollection.Empty;
localVariables.UpdateTo(VariableCollection.Empty);
} else {
return CurrentFunction.GetVariables();
localVariables.UpdateTo(CurrentFunction.GetVariables());
}
return localVariables;
}
}
}

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

@ -136,6 +136,28 @@ namespace Debugger @@ -136,6 +136,28 @@ namespace Debugger
{
VariableCollection mergedCollection = VariableCollection.Merge(collections);
mergedCollection.Update();
// Update existing variables
foreach(Variable variable in mergedCollection) {
if (this.Contains(variable.Name)) {
//this[variable.Name].CorValue = variable.CorValue;
}
}
// Add new variables
foreach(Variable variable in mergedCollection) {
if (!this.Contains(variable.Name)) {
this.Add(variable);
}
}
// Remove variables that are not in merged collection
foreach(Variable variable in this) {
if (!mergedCollection.Contains(variable.Name)) {
this.Remove(variable);
}
}
}
protected virtual void OnVariableAdded(VariableEventArgs e)

Loading…
Cancel
Save