SyncTask.2.cs 452 B

1234567891011121314151617181920212223242526
  1. using System;
  2. using System.Collections.Generic;
  3. namespace com.workman.cm3d2.task
  4. {
  5. public class SyncTask<T> : Task<T>
  6. {
  7. public SyncTask(List<Task<T>> listSyncTask)
  8. {
  9. this.listSyncTask = listSyncTask;
  10. }
  11. public override void Execute()
  12. {
  13. foreach (Task<T> task in this.listSyncTask)
  14. {
  15. if (task.action != null && task.param != null)
  16. {
  17. task.action(task.param);
  18. }
  19. }
  20. }
  21. public List<Task<T>> listSyncTask;
  22. }
  23. }