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:
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
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.
20 // Copyright (c) 2004-2005 Novell, Inc.
23 // Jordi Mas i Hernandez, jordi@ximian.com
31 using System.Collections;
32 using System.ComponentModel;
33 using System.Reflection;
35 namespace System.Windows.Forms
37 public abstract class ListControl : Control
39 string display_member;
41 protected ListControl ()
43 display_member = string.Empty;
47 public event EventHandler DataSourceChanged;
48 public event EventHandler DisplayMemberChanged;
49 public event EventHandler SelectedValueChanged;
50 public event EventHandler ValueMemberChanged;
53 #region Public Properties
54 //protected CurrencyManager DataManager {
55 //get {throw new NotImplementedException (); };
59 [RefreshProperties(RefreshProperties.Repaint)]
60 [TypeConverter("System.Windows.Forms.Design.DataSourceConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
61 public object DataSource {
62 get {throw new NotImplementedException (); }
63 set {throw new NotImplementedException (); }
67 [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))]
68 [TypeConverter("System.Windows.Forms.Design.DataMemberFieldConverter, System.Design, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
69 public string DisplayMember {
70 get { return display_member; }
71 set { display_member = value; }
74 public abstract int SelectedIndex {
79 [Bindable(BindableSupport.Yes)]
82 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
83 public object SelectedValue {
84 get {throw new NotImplementedException (); }
85 set {throw new NotImplementedException (); }
89 [Editor("System.Windows.Forms.Design.DataMemberFieldEditor, " + Consts.AssemblySystem_Design, typeof(System.Drawing.Design.UITypeEditor))]
90 public string ValueMember {
91 get {throw new NotImplementedException (); }
92 set {throw new NotImplementedException (); }
95 #endregion Public Properties
97 #region Public Methods
99 protected object FilterItemOnProperty (object item)
101 throw new NotImplementedException ();
104 protected object FilterItemOnProperty (object item, string field)
106 throw new NotImplementedException ();
109 public string GetItemText (object item)
111 throw new NotImplementedException ();
114 // Used only by ListBox to avoid to break Listbox's member signature
115 protected override bool IsInputKey (Keys keyData)
126 case Keys.ControlKey:
136 protected override void OnBindingContextChanged (EventArgs e)
141 protected virtual void OnDataSourceChanged (EventArgs e)
146 protected virtual void OnDisplayMemberChanged (EventArgs e)
151 protected virtual void OnSelectedIndexChanged (EventArgs e)
156 protected virtual void OnSelectedValueChanged (EventArgs e)
161 protected virtual void OnValueMemberChanged (EventArgs e)
166 protected abstract void RefreshItem (int index);
168 protected virtual void SetItemCore (int index, object value)
173 protected abstract void SetItemsCore (IList items);
176 #endregion Public Methods