2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / class / System.Design / System.Windows.Forms.Design / ComponentTray.cs
blob6d2445016084336fa6d0d195eaee70b86a0a5a79
1 //
2 // System.Windows.Forms.Design.ComponentTray
3 //
4 // Authors:
5 // Ivan N. Zlatev (contact i-nZ.net)
6 //
7 // (C) 2006-2007 Ivan N. Zlatev
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining
11 // a copy of this software and associated documentation files (the
12 // "Software"), to deal in the Software without restriction, including
13 // without limitation the rights to use, copy, modify, merge, publish,
14 // distribute, sublicense, and/or sell copies of the Software, and to
15 // permit persons to whom the Software is furnished to do so, subject to
16 // the following conditions:
18 // The above copyright notice and this permission notice shall be
19 // included in all copies or substantial portions of the Software.
21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
25 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 // STUBS ONLY!!!
34 using System;
35 using System.ComponentModel;
36 using System.ComponentModel.Design;
37 using System.Windows.Forms;
38 using System.Drawing;
39 using System.Drawing.Design;
40 using System.Collections;
42 namespace System.Windows.Forms.Design
44 [DesignTimeVisible (false)]
45 [ToolboxItem (false)]
46 [ProvideProperty ("Location", typeof (IComponent))]
47 public class ComponentTray : ScrollableControl, IExtenderProvider
50 private IServiceProvider _serviceProvider;
51 private IDesigner _mainDesigner = null;
52 private bool _showLargeIcons = false;
53 private bool _autoArrange = false;
55 public ComponentTray (IDesigner mainDesigner, IServiceProvider serviceProvider)
57 if (mainDesigner == null) {
58 throw new ArgumentNullException ("mainDesigner");
60 if (serviceProvider == null) {
61 throw new ArgumentNullException ("serviceProvider");
64 _mainDesigner = mainDesigner;
65 _serviceProvider = serviceProvider;
68 public bool AutoArrange {
69 get { return _autoArrange; }
70 set { _autoArrange = value; }
73 [MonoTODO]
74 public int ComponentCount {
75 get { return 0; }
78 public bool ShowLargeIcons {
79 get { return _showLargeIcons; }
80 set { _showLargeIcons = value; }
84 [MonoTODO]
85 public virtual void AddComponent (IComponent component)
89 protected virtual bool CanCreateComponentFromTool (ToolboxItem tool)
91 return true;
94 protected virtual bool CanDisplayComponent (IComponent component)
96 return false;
99 [MonoTODO]
100 public void CreateComponentFromTool (ToolboxItem tool)
104 [MonoTODO]
105 protected void DisplayError (Exception e)
109 protected override void Dispose (bool disposing)
113 #if NET_2_0
114 [Browsable (false)]
115 [Category ("Layout")]
116 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
117 [DesignOnly (true)]
118 [Localizable (false)]
119 #endif
120 [MonoTODO]
121 public Point GetLocation (IComponent receiver)
123 return new Point (0,0);
126 [MonoTODO]
127 public void SetLocation (IComponent receiver, Point location)
131 #if NET_2_0
132 [MonoTODO]
133 public IComponent GetNextComponent (IComponent component, bool forward)
135 throw new NotImplementedException ();
138 [Browsable (false)]
139 [Category ("Layout")]
140 [DesignOnly (true)]
141 [Localizable (false)]
142 [MonoTODO]
143 public Point GetTrayLocation (IComponent receiver)
145 throw new NotImplementedException ();
148 [MonoTODO]
149 public bool IsTrayComponent (IComponent comp)
151 throw new NotImplementedException ();
154 [MonoTODO]
155 public void SetTrayLocation (IComponent receiver, Point location)
157 throw new NotImplementedException ();
160 [MonoTODO]
161 protected override void OnMouseDoubleClick (MouseEventArgs e)
164 #else
165 [MonoTODO]
166 protected override void OnDoubleClick (EventArgs e)
169 #endif
171 [MonoTODO]
172 protected override void OnDragDrop (DragEventArgs de)
176 [MonoTODO]
177 protected override void OnDragEnter (DragEventArgs de)
181 [MonoTODO]
182 protected override void OnDragLeave (EventArgs e)
186 [MonoTODO]
187 protected override void OnDragOver (DragEventArgs de)
191 [MonoTODO]
192 protected override void OnGiveFeedback (GiveFeedbackEventArgs gfevent)
196 [MonoTODO]
197 protected override void OnLayout (LayoutEventArgs levent)
201 [MonoTODO]
202 protected virtual void OnLostCapture ()
206 [MonoTODO]
207 protected override void OnMouseDown (MouseEventArgs e)
211 [MonoTODO]
212 protected override void OnMouseMove (MouseEventArgs e)
216 [MonoTODO]
217 protected override void OnMouseUp (MouseEventArgs e)
221 [MonoTODO]
222 protected override void OnPaint (PaintEventArgs pe)
226 [MonoTODO]
227 protected virtual void OnSetCursor ()
231 [MonoTODO]
232 public virtual void RemoveComponent (IComponent component)
236 [MonoTODO]
237 protected override void WndProc (ref Message m)
239 base.WndProc (ref m);
242 bool IExtenderProvider.CanExtend (object component)
244 return false;
247 protected override object GetService (Type service)
249 if (_serviceProvider != null) {
250 return _serviceProvider.GetService (service);
252 return null;