ListComponent.cs 418 B

12345678910111213141516171819
  1. using System;
  2. using System.Collections.Generic;
  3. namespace ET
  4. {
  5. public class ListComponent<T>: List<T>, IDisposable
  6. {
  7. public static ListComponent<T> Create()
  8. {
  9. return ObjectPool.Instance.Fetch(typeof (ListComponent<T>)) as ListComponent<T>;
  10. }
  11. public void Dispose()
  12. {
  13. this.Clear();
  14. ObjectPool.Instance.Recycle(this);
  15. }
  16. }
  17. }