muf
muf copied to clipboard
Problems on changes from outside the UI thread: System.InvalidOperationException
Not so much of an issue as a warning to others. If you have a need to load your monitored document in the background from a BackgroundWorker, you may run into a sporadic error.
"System.InvalidOperationException: 'Collection was modified; enumeration operation may not execute.'"
the cure for this is to make sure you are doing all your operations in the UI thread. Or It may be that the MUF code could be changed to make sure that all operations occur on the UI thread.
I'll need to investigate if/how we might enhance the library to help prevent this.
Hi Nathan, It might work out to do an IgnoreBatch similar to an UndoBatch. In the case of the editor I am maintaining, I would set up the ignore, do the long running operations, then end the ignore. At that point, start an undo batch, and replace the old file property for the new. If you are accepting pull requests I would be willing to work on this. Thanks for this very useful package.