Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/29/09 02:33:57 (14 years ago)
Author:
swagner
Message:

Implemented IDisposable and unified extension capabilities for all observable collections (#819)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Collections/3.3/ObservableList.cs

    r2574 r2575  
    7070    public ObservableList(IEnumerable<T> collection) {
    7171      list = new List<T>(collection);
     72      OnItemsAdded(GetIndexedItems());
     73    }
     74    #endregion
     75
     76    #region Destructors
     77    ~ObservableList() {
     78      Dispose(false);
     79    }
     80    protected virtual void Dispose(bool disposing) {
     81      if (disposing) {
     82        Clear();
     83      }
     84    }
     85    public void Dispose() {
     86      Dispose(true);
     87      GC.SuppressFinalize(this);
    7288    }
    7389    #endregion
Note: See TracChangeset for help on using the changeset viewer.