Пример #1
0
        void IBookmarks.PurgeBookmarksForDisposedThreads()
        {
            Lazy <List <IBookmark> > removedBookmarks = new Lazy <List <IBookmark> >(() => new List <IBookmark>());

            if (ListUtils.RemoveAll(items, bmk => bmk.Thread.IsDisposed, bmk => removedBookmarks.Value.Add(bmk)) > 0)
            {
                FireOnBookmarksChanged(new BookmarksChangedEventArgs(BookmarksChangedEventArgs.ChangeType.Purged, removedBookmarks.Value.ToArray()));
            }
        }
Пример #2
0
 int DeleteNotExistingFactories()
 {
     foreach (var f in factories)
     {
         if (f.markedForDeletion)
         {
             tracer.Info("factory '{0}' does not exist anymore. disposing it.", f.factory.Location);
             f.factory.Dispose();
         }
     }
     return(ListUtils.RemoveAll(factories, f => f.markedForDeletion));
 }