Index: Core/Common/src/Core.Common.Base/Observable.cs
===================================================================
diff -u -r1e4d2363eb853577139c402364c4462dad821046 -r94ef875f26bff005b1d53880c92f350b373a31ec
--- Core/Common/src/Core.Common.Base/Observable.cs (.../Observable.cs) (revision 1e4d2363eb853577139c402364c4462dad821046)
+++ Core/Common/src/Core.Common.Base/Observable.cs (.../Observable.cs) (revision 94ef875f26bff005b1d53880c92f350b373a31ec)
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Linq;
namespace Core.Common.Base
{
@@ -35,8 +36,15 @@
///
public void NotifyObservers()
{
- foreach (var observer in observers)
+ // Iterate through a copy of the list of observers; an update of one observer might result in detaching another observer (which will result in a "list modified" exception over here otherwise)
+ foreach (var observer in observers.ToList())
{
+ // Ensure the observer is still part of the original list of observers
+ if (!observers.Contains(observer))
+ {
+ continue;
+ }
+
observer.UpdateObserver();
}
}
Index: Core/Common/src/Core.Common.Base/Project.cs
===================================================================
diff -u -r04f06b5762b758295a52944dd232394a462cf72c -r94ef875f26bff005b1d53880c92f350b373a31ec
--- Core/Common/src/Core.Common.Base/Project.cs (.../Project.cs) (revision 04f06b5762b758295a52944dd232394a462cf72c)
+++ Core/Common/src/Core.Common.Base/Project.cs (.../Project.cs) (revision 94ef875f26bff005b1d53880c92f350b373a31ec)
@@ -1,13 +1,11 @@
-using System.Collections.Generic;
-using System.Linq;
using Core.Common.Utils.Collections.Generic;
namespace Core.Common.Base
{
///
/// Container of all data and tasks.
///
- public class Project : IObservable
+ public class Project : Observable
{
///
/// Creates instance of the Project.
@@ -39,29 +37,5 @@
/// The items in the project.
///
public IEventedList