DeviceSpecificChoiceCollection.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /**
  2. * Project : Mono
  3. * Namespace : System.Web.UI.MobileControls
  4. * Class : DeviceSpecificChoiceCollection
  5. * Author : Gaurav Vaish
  6. *
  7. * Copyright : 2003 with Gaurav Vaish, and with
  8. * Ximian Inc
  9. */
  10. using System.Collections;
  11. using System.Reflection;
  12. using System.Web.UI;
  13. using System.Web.Mobile;
  14. namespace System.Web.UI.MobileControls
  15. {
  16. public class DeviceSpecificChoiceCollection
  17. : ArrayListCollectionBase
  18. {
  19. private DeviceSpecific owner;
  20. internal DeviceSpecificChoiceCollection(DeviceSpecific owner)
  21. {
  22. this.owner = owner;
  23. }
  24. public DeviceSpecificChoice this[int index]
  25. {
  26. get
  27. {
  28. return (DeviceSpecificChoice)base.Items[index];
  29. }
  30. }
  31. public ArrayList All
  32. {
  33. get
  34. {
  35. return base.Items;
  36. }
  37. }
  38. public void Add(DeviceSpecificChoice choice)
  39. {
  40. AddAt(-1, choice);
  41. }
  42. public void AddAt(int index, DeviceSpecificChoice choice)
  43. {
  44. choice.Owner = owner;
  45. if(index == -1)
  46. Items.Add(choice);
  47. else
  48. Items.Insert(index, choice);
  49. }
  50. public void Clear()
  51. {
  52. Items.Clear();
  53. }
  54. }
  55. }