File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,14 +84,32 @@ public void Insert(int index, T item)
8484 {
8585 RWLock . ExitWriteLock ( ) ;
8686 }
87- OnCollectionChanged ( new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Add , ( object ) item , index ) ) ;
87+ OnCollectionChanged ( new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Add , item , index ) ) ;
8888 }
8989
9090 protected virtual void Insert_Internal ( int index , T item )
9191 {
9292 Inner . Insert ( index , item ) ;
9393 }
9494
95+
96+ public void AddRange ( IEnumerable < T > items )
97+ {
98+ RWLock . EnterWriteLock ( ) ;
99+ try
100+ {
101+ foreach ( var item in items )
102+ {
103+ Insert_Internal ( Inner . Count , item ) ;
104+ OnCollectionChanged ( new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction . Add , item , Inner . Count ) ) ;
105+ }
106+ }
107+ finally
108+ {
109+ RWLock . ExitWriteLock ( ) ;
110+ }
111+ }
112+
95113 public void RemoveAt ( int index )
96114 {
97115 object item ;
You can’t perform that action at this time.
0 commit comments