AFieldTemplate.cs 570 B

1234567891011121314151617181920212223242526272829303132
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Web;
  6. using System.Web.UI;
  7. namespace MonoTests.Common
  8. {
  9. class AFieldTemplate : ITemplate
  10. {
  11. public List <Control> Controls { get; private set; }
  12. public AFieldTemplate ()
  13. {
  14. Controls = new List<Control> ();
  15. }
  16. public void InstantiateIn (Control container)
  17. {
  18. if (container == null)
  19. return;
  20. List <Control> controls = Controls;
  21. if (controls.Count == 0)
  22. return;
  23. foreach (Control c in controls)
  24. container.Controls.Add (c);
  25. }
  26. }
  27. }