Task.2.cs 372 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. namespace com.workman.cm3d2.task
  3. {
  4. public class Task<T> : Task
  5. {
  6. public Task()
  7. {
  8. }
  9. public Task(Action<T> action, T param)
  10. {
  11. this.action = action;
  12. this.param = param;
  13. }
  14. public override void Execute()
  15. {
  16. if (this.action != null)
  17. {
  18. this.action(this.param);
  19. }
  20. }
  21. public new Action<T> action;
  22. public T param;
  23. }
  24. }