MobileListItemCollection.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /**
  2. * Project : Mono
  3. * Namespace : System.Web.UI.MobileControls
  4. * Class : MobileListItemCollection
  5. * Author : Gaurav Vaish
  6. *
  7. * Copyright : 2003 with Gaurav Vaish, and with
  8. * Ximian Inc
  9. */
  10. using System;
  11. using System.Collections;
  12. using System.Web.UI;
  13. namespace System.Web.UI.MobileControls
  14. {
  15. public class MobileListItemCollection : ArrayListCollectionBase,
  16. IStateManager
  17. {
  18. private int baseIndex = 0;
  19. private bool marked = false;
  20. private bool saveAll = false;
  21. private bool saveSel = false;
  22. public MobileListItemCollection()
  23. {
  24. }
  25. public MobileListItemCollection(ArrayList items) : base(items)
  26. {
  27. }
  28. void IStateManager.LoadViewState(object state)
  29. {
  30. throw new NotImplementedException();
  31. }
  32. object IStateManager.SaveViewState()
  33. {
  34. throw new NotImplementedException();
  35. }
  36. void IStateManager.TrackViewState()
  37. {
  38. this.marked = true;
  39. throw new NotImplementedException();
  40. }
  41. bool IStateManager.IsTrackingViewState
  42. {
  43. get
  44. {
  45. return this.marked;
  46. }
  47. }
  48. public void Add(string item)
  49. {
  50. Add(new MobileListItem(item));
  51. }
  52. public void Add(MobileListItem item)
  53. {
  54. throw new NotImplementedException();
  55. }
  56. public MobileListItem this[int index]
  57. {
  58. get
  59. {
  60. return (MobileListItem)base.Items[index];
  61. }
  62. }
  63. public void Clear()
  64. {
  65. base.Items.Clear();
  66. if(this.marked)
  67. this.saveAll = true;
  68. }
  69. public bool Contains(MobileListItem item)
  70. {
  71. return Items.Contains(item);
  72. }
  73. public MobileListItem[] GetAll()
  74. {
  75. MobileListItem[] retVal = new MobileListItem[Items.Count];
  76. if(Items.Count > 0)
  77. Items.CopyTo(0, retVal, 0, Items.Count);
  78. return retVal;
  79. }
  80. public int IndexOf(MobileListItem item)
  81. {
  82. return Items.IndexOf(item);
  83. }
  84. public virtual void Insert(int index, string item)
  85. {
  86. Insert(index, new MobileListItem(item));
  87. }
  88. public void Insert(int index, MobileListItem item)
  89. {
  90. Items.Insert(index, item);
  91. throw new NotImplementedException();
  92. }
  93. public void Remove(string item)
  94. {
  95. RemoveAt(IndexOf(new MobileListItem(item)));
  96. }
  97. public void Remove(MobileListItem item)
  98. {
  99. RemoveAt(IndexOf(item));
  100. }
  101. public void RemoveAt(int index)
  102. {
  103. if(index >= 0)
  104. {
  105. Items.RemoveAt(index);
  106. throw new NotImplementedException();
  107. }
  108. }
  109. public void SetAll(MobileListItem[] items)
  110. {
  111. throw new NotImplementedException();
  112. }
  113. public int BaseIndex
  114. {
  115. get
  116. {
  117. return this.baseIndex;
  118. }
  119. set
  120. {
  121. this.baseIndex = value;
  122. }
  123. }
  124. public bool SaveSelection
  125. {
  126. get
  127. {
  128. return this.saveSel;
  129. }
  130. set
  131. {
  132. this.saveSel = value;
  133. }
  134. }
  135. }
  136. }