ListControl.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. // Permission is hereby granted, free of charge, to any person obtaining
  2. // a copy of this software and associated documentation files (the
  3. // "Software"), to deal in the Software without restriction, including
  4. // without limitation the rights to use, copy, modify, merge, publish,
  5. // distribute, sublicense, and/or sell copies of the Software, and to
  6. // permit persons to whom the Software is furnished to do so, subject to
  7. // the following conditions:
  8. //
  9. // The above copyright notice and this permission notice shall be
  10. // included in all copies or substantial portions of the Software.
  11. //
  12. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  13. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  14. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  15. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  16. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  17. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  18. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  19. //
  20. // Copyright (c) 2004 Novell, Inc.
  21. //
  22. // Authors:
  23. // Jordi Mas i Hernandez, [email protected]
  24. //
  25. //
  26. // NOT COMPLETE
  27. using System;
  28. using System.Drawing;
  29. using System.Collections;
  30. using System.ComponentModel;
  31. using System.Reflection;
  32. namespace System.Windows.Forms
  33. {
  34. public abstract class ListControl : Control
  35. {
  36. string display_member;
  37. protected ListControl ()
  38. {
  39. display_member = string.Empty;
  40. }
  41. #region Events
  42. public event EventHandler DataSourceChanged;
  43. public event EventHandler DisplayMemberChanged;
  44. public event EventHandler SelectedValueChanged;
  45. public event EventHandler ValueMemberChanged;
  46. #endregion // Events
  47. #region Public Properties
  48. //protected CurrencyManager DataManager {
  49. //get {throw new NotImplementedException (); };
  50. //}
  51. public object DataSource {
  52. get {throw new NotImplementedException (); }
  53. set {throw new NotImplementedException (); }
  54. }
  55. string DisplayMember {
  56. get { return display_member; }
  57. set { display_member = value; }
  58. }
  59. public abstract int SelectedIndex {
  60. get;
  61. set;
  62. }
  63. public object SelectedValue {
  64. get {throw new NotImplementedException (); }
  65. set {throw new NotImplementedException (); }
  66. }
  67. public string ValueMember {
  68. get {throw new NotImplementedException (); }
  69. set {throw new NotImplementedException (); }
  70. }
  71. #endregion Public Properties
  72. #region Public Methods
  73. protected object FilterItemOnProperty (object item)
  74. {
  75. throw new NotImplementedException ();
  76. }
  77. protected object FilterItemOnProperty (object item, string field)
  78. {
  79. throw new NotImplementedException ();
  80. }
  81. public string GetItemText (object item)
  82. {
  83. throw new NotImplementedException ();
  84. }
  85. protected override bool IsInputKey (Keys keyData)
  86. {
  87. return base.IsInputKey (keyData);
  88. }
  89. protected override void OnBindingContextChanged (EventArgs e)
  90. {
  91. }
  92. protected virtual void OnDataSourceChanged (EventArgs e)
  93. {
  94. }
  95. protected virtual void OnDisplayMemberChanged (EventArgs e)
  96. {
  97. }
  98. protected virtual void OnSelectedIndexChanged (EventArgs e)
  99. {
  100. }
  101. protected virtual void OnSelectedValueChanged (EventArgs e)
  102. {
  103. }
  104. protected virtual void OnValueMemberChanged (EventArgs e)
  105. {
  106. }
  107. protected abstract void RefreshItem (int index);
  108. protected virtual void SetItemCore (int index, object value)
  109. {
  110. }
  111. protected abstract void SetItemsCore (IList items);
  112. #endregion Public Methods
  113. }
  114. }