src/NetStandard/Collections/Synchronization/src/CollectionModificationIterationTools.cs
/// <summary>
/// Iterates each previously added action handler per modification item.
/// </summary>
Iterates each previously added action handler per modification item.
Iterates each previously added action handler per modification item .
public void Iterate()
            {
                var iterationContext = new CollectionModificationIterationContext(collectionStartIndex);
                void invokeIterationStep(int modificationItemIndex)
                {
                    foreach (var handler in handlers) {
                        iterationContext.ModificationItemIndex = modificationItemIndex;
                        handler.Invoke(iterationContext);
                    }
                }
                if (IteratesBackward) {
                    for (var modificationItemIndex = iterationCount - 1; modificationItemIndex >= 0; modificationItemIndex--) {
                        invokeIterationStep(modificationItemIndex);
                    }
                } else {
                    for (var modificationItemIndex = 0; modificationItemIndex < iterationCount; modificationItemIndex++) {
                        invokeIterationStep(modificationItemIndex);
                    }
                }
            }
public void Iterate ( ) { var iterationContext = new CollectionModificationIterationContext ( collectionStartIndex ) ; void invokeIterationStep ( int modificationItemIndex ) { foreach ( var handler in handlers ) { iterationContext . ModificationItemIndex = modificationItemIndex ; handler . Invoke ( iterationContext ) ; } } if ( IteratesBackward ) { for ( var modificationItemIndex = iterationCount - 1 ; modificationItemIndex >= 0 ; modificationItemIndex -- ) { invokeIterationStep ( modificationItemIndex ) ; } } else { for ( var modificationItemIndex = 0 ; modificationItemIndex < iterationCount ; modificationItemIndex ++ ) { invokeIterationStep ( modificationItemIndex ) ; } } }
Iterates each previously added action handler per modification item.
Iterates each previously added action handler per modification item .