Created
October 24, 2009 18:12
-
-
Save panesofglass/217649 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DetailLoaderWithProgressItem<T> : IDetailLoader<T> | |
{ | |
private IDetailLoader<T> _loader; | |
private ProgressItem _progressItem; | |
public DetailLoaderWithProgressItem(IDetailLoader<T> loader, ProgressItem progressItem) | |
{ | |
_loader = loader; | |
_progressItem = progressItem; | |
} | |
public void Load(string importPath, Action<T> addToBatch) | |
{ | |
_loader.Load(importPath, addToBatch); | |
_progressItem.EndWithSuccess(); | |
} | |
public IEnumerable<T> GetDetailItems(IEnumerable<Row> rows) | |
{ | |
_progressItem.Start(rows.Count()); | |
return _loader.GetDetailItems(rows); | |
} | |
public T GetDetailItemFrom(Row row) | |
{ | |
_progressItem.IncrementProgress(); | |
return _loader.GetDetailItemFrom(row); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment