More code-style changes
[mono.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / AxHost.cs
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) 2005 Novell, Inc. (http://www.novell.com)
21 //
22 // Authors:
23 //      Peter Bartok    <pbartok@novell.com>
24 //
25 //
26
27 using System;
28 using System.ComponentModel;
29 using System.Drawing;
30 using System.IO;
31 using System.Runtime.InteropServices;
32 using System.Runtime.Serialization;
33
34 namespace System.Windows.Forms {
35         [MonoTODO("Possibly implement this for Win32; find a way for Linux and Mac")]
36         [DefaultEvent("Enter")]
37         [Designer("System.Windows.Forms.Design.AxHostDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
38         [DesignTimeVisible(false)]
39         [ToolboxItem(false)]
40         [ClassInterface (ClassInterfaceType.AutoDispatch)]
41         [ComVisible (true)]
42         public abstract class AxHost : Control, ISupportInitialize, ICustomTypeDescriptor {
43                 #region AxHost Subclasses
44                 #region AxHost.ActiveXInvokeKind Enum
45                 public enum ActiveXInvokeKind {
46                         MethodInvoke    = 0,
47                         PropertyGet     = 1,
48                         PropertySet     = 2
49                 }
50                 #endregion      // AxHost.ActiveXInvokeKind Enum
51
52                 #region AxHost.AxComponentEditor Class
53                 [ComVisible (false)]
54                 public class AxComponentEditor : System.Windows.Forms.Design.WindowsFormsComponentEditor {
55                         public AxComponentEditor ()
56                         {
57                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
58                         }
59
60                         public override bool EditComponent (ITypeDescriptorContext context, object obj, IWin32Window parent)
61                         {
62                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
63                         }
64                 }
65                 #endregion      // AxHost.AxComponentEditor Class
66
67                 #region AxHost.ClsidAttribute
68                 [AttributeUsage(AttributeTargets.Class,Inherited=false)]
69                 public sealed class ClsidAttribute : Attribute {
70                         string clsid;
71
72                         public ClsidAttribute (string clsid)
73                         {
74                                 this.clsid = clsid;
75                         }
76
77                         public string Value {
78                                 get { return clsid; }
79                         }
80                 }
81                 #endregion AxHost.ClsidAttribute
82                 
83                 #region AxHost.ConnectionPointCookie
84                 public class ConnectionPointCookie {
85                         public ConnectionPointCookie (object source, object sink, Type eventInterface)
86                         {
87                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
88                         }
89
90                         public void Disconnect ()
91                         {
92                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
93                         }
94
95                         ~ConnectionPointCookie ()
96                         {
97                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
98                         }
99                 }
100                 #endregion      // AxHost.ConnectionPointCookie
101                 
102                 #region AxHost.InvalidActiveXStateException  Class
103                 public class InvalidActiveXStateException : Exception {
104                         private string mName;
105                         private ActiveXInvokeKind mKind;
106
107                         public InvalidActiveXStateException ()
108                         {
109
110                         }
111
112                         public InvalidActiveXStateException (string name, ActiveXInvokeKind kind)
113                         {
114                                 mName = name;
115                                 mKind = kind;
116                         }
117
118                         public override string ToString ()
119                         {
120                                 if(mKind == ActiveXInvokeKind.MethodInvoke)
121                                         return "Invoke:" + mName;
122                                 else if(mKind == ActiveXInvokeKind.PropertyGet)
123                                         return "PropertyGet:" + mName;
124                                 else if(mKind == ActiveXInvokeKind.PropertySet)
125                                         return "PropertySet:" + mName;
126
127                                 return base.ToString();
128                         }
129                 }
130                 #endregion      // AxHost.InvalidActiveXStateException  Class
131                         
132                 #region AxHost.State Class
133                 [Serializable]
134                 [TypeConverter("System.ComponentModel.TypeConverter, " + Consts.AssemblySystem)]
135                 public class State : ISerializable {
136                         public State (Stream ms, int storageType, bool manualUpdate, string licKey)
137                         {
138                                 //throw new NotImplementedException("COM/ActiveX support is not implemented");
139                         }
140
141                         protected State (SerializationInfo info, StreamingContext context)
142                         {
143                         }
144
145                         void ISerializable.GetObjectData (SerializationInfo si,StreamingContext context)
146                         {
147                                 //throw new NotImplementedException("COM/ActiveX support is not implemented");
148                         }
149                 }
150                 #endregion      // AxHost.State Class
151
152                 #region AxHost.TypeLibraryTimeStampAttribute Class
153                 [AttributeUsage(AttributeTargets.Assembly, Inherited=false)]
154                 public sealed class TypeLibraryTimeStampAttribute : Attribute {
155                         public TypeLibraryTimeStampAttribute (string timestamp)
156                         {
157                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
158                         }
159
160                         public DateTime Value {
161                                 get {
162                                         throw new NotImplementedException("COM/ActiveX support is not implemented");
163                                 }
164                         }
165                 }
166                 #endregion      // AxHost.TypeLibraryTimeStampAttribute Class
167
168                 #region AxHost.StateConverter Class
169                 public class StateConverter : System.ComponentModel.TypeConverter {
170                         public StateConverter ()
171                         {
172                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
173                         }
174
175                         public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
176                         {
177                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
178                         }
179
180                         public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
181                         {
182                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
183                         }
184
185                         public override object ConvertFrom (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
186                         {
187                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
188                         }
189
190                         public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
191                         {
192                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
193                         }
194                 }
195                 #endregion      // AxHost.StateConverter Class
196                 #endregion      // AxHost Subclasses
197
198                 //private int flags;
199                 private Guid clsid;
200                 private object instance;
201                 private AboutBoxDelegate aboutDelegate = null;
202                 private AxHost.State ocxState = null;
203                 static bool runningOnWindows;
204
205                 #region Protected Constructors
206
207                 protected AxHost (string clsid) : this(clsid, 0)
208                 {
209
210                 }
211
212                 protected AxHost (string clsid, int flags)
213                 {
214                         this.clsid = new Guid(clsid);
215                         //this.flags = flags;
216                         this.instance = null;
217
218                         PlatformID pid = Environment.OSVersion.Platform;
219                         runningOnWindows = ((int) pid != 128 && (int) pid != 4 && (int) pid != 6);
220                 }
221                 #endregion      // Public Instance Properties
222
223                 #region Public Instance Properties
224                 [Browsable (false)]
225                 [EditorBrowsable (EditorBrowsableState.Never)]
226                 public override Color BackColor {
227                         get {
228                                 return base.BackColor;
229                         }
230                         set {
231                                 base.BackColor = value;
232                         }
233                 }
234                 
235                 [Browsable (false)]
236                 [EditorBrowsable (EditorBrowsableState.Never)]
237                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
238                 public override Image BackgroundImage {
239                         get {
240                                 return base.BackgroundImage;
241                         }
242
243                         set {
244                                 base.BackgroundImage = value;
245                         }
246                 }
247
248                 [Browsable (false)]
249                 [EditorBrowsable (EditorBrowsableState.Never)]
250                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
251                 public override ImageLayout BackgroundImageLayout {
252                         get {
253                                 return base.BackgroundImageLayout;
254                         }
255
256                         set {
257                                 base.BackgroundImageLayout = value;
258                         }
259                 }
260                 
261                 [Browsable (false)]
262                 [EditorBrowsable (EditorBrowsableState.Advanced)]
263                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
264                 public ContainerControl ContainingControl {
265                         get {
266                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
267                         }
268
269                         set {
270                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
271                         }
272                 }
273                 
274                 [Browsable (false)]
275                 [EditorBrowsable (EditorBrowsableState.Never)]
276                 public override ContextMenu ContextMenu {
277                         get {
278                                 return base.ContextMenu;
279                         }
280
281                         set {
282                                 base.ContextMenu = value;
283                         }
284                 }
285                 
286                 [Browsable (false)]
287                 [EditorBrowsable (EditorBrowsableState.Never)]
288                 public override Cursor Cursor {
289                         get {
290                                 return base.Cursor;
291                         }
292
293                         set {
294                                 base.Cursor = value;
295                         }
296                 }
297                 
298                 [Browsable (false)]
299                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
300                 [EditorBrowsable (EditorBrowsableState.Advanced)]
301                 public bool EditMode {
302                         get {
303                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
304                         }
305                 }
306
307                 [Browsable (false)]
308                 [EditorBrowsable (EditorBrowsableState.Never)]
309                 public new virtual bool Enabled {
310                         get {
311                                 return base.Enabled;
312                         }
313
314                         set {
315                                 base.Enabled = value;
316                         }
317                 }
318                 
319                 [Browsable (false)]
320                 [EditorBrowsable (EditorBrowsableState.Never)]
321                 public override Font Font {
322                         get {
323                                 return base.Font;
324                         }
325
326                         set {
327                                 base.Font = value;
328                         }
329                 }
330                 
331                 [Browsable (false)]
332                 [EditorBrowsable (EditorBrowsableState.Never)]
333                 public override Color ForeColor {
334                         get { 
335                                 return base.ForeColor;
336                         }
337
338                         set {
339                                 base.ForeColor = value;
340                         }
341                 }
342                 
343                 [Browsable (false)]
344                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
345                 [EditorBrowsable (EditorBrowsableState.Advanced)]
346                 public bool HasAboutBox {
347                         get {
348                                 return aboutDelegate != null;
349                         }
350                 }
351
352                 [Browsable (false)]
353                 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
354                 [EditorBrowsable (EditorBrowsableState.Never)]
355                 public new ImeMode ImeMode {
356                         get { 
357                                 return base.ImeMode;
358                         }
359                         set { 
360                                 base.ImeMode = value;
361                         }
362                 }
363                 
364                 [Browsable (false)]
365                 [DefaultValue (null)]
366                 [EditorBrowsable (EditorBrowsableState.Advanced)]
367                 [RefreshProperties (RefreshProperties.All)]
368                 public AxHost.State OcxState {
369                         get {
370                                 return ocxState;
371                         }
372
373                         set {
374                                 if (ocxState == value || value == null)
375                                 {
376                                         return;
377                                 }
378                                 this.ocxState = value;
379                         }
380                 }
381                 
382                 [Browsable (false)]
383                 [EditorBrowsable (EditorBrowsableState.Never)]
384                 [Localizable (true)]
385                 public new virtual bool RightToLeft {
386                         get {
387                                 return base.RightToLeft == System.Windows.Forms.RightToLeft.Yes;
388                         }
389
390                         set {
391                                 base.RightToLeft = (value ? System.Windows.Forms.RightToLeft.Yes : 
392                                                        System.Windows.Forms.RightToLeft.No);
393                         }
394                 }
395                 
396                 public override ISite Site {
397                         set {
398                                 throw new NotImplementedException("COM/ActiveX support is not implemented");
399                         }
400                 }
401
402                 [Browsable (false)]
403                 [EditorBrowsable (EditorBrowsableState.Never)]
404                 public override string Text {
405                         get { return base.Text; }
406                         set { base.Text = value; }
407                 }
408                 #endregion      // Protected Constructors
409                 
410                 #region Protected Instance Properties
411                 protected override CreateParams CreateParams {
412                         get { return base.CreateParams; }
413                 }
414                 
415                 protected override Size DefaultSize {
416                         get {
417                                 return new Size (75, 23);
418                         }
419                 }
420                 #endregion      // Protected Instance Properties
421
422                 #region Protected Static Methods
423                 [CLSCompliant(false)]
424                 [EditorBrowsable (EditorBrowsableState.Advanced)]
425                 protected static Color GetColorFromOleColor (uint color)
426                 {
427                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
428                 }
429
430                 [EditorBrowsable (EditorBrowsableState.Advanced)]
431                 protected static Font GetFontFromIFont (object font)
432                 {
433                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
434                 }
435
436                 [EditorBrowsable (EditorBrowsableState.Advanced)]
437                 protected static Font GetFontFromIFontDisp (object font)
438                 {
439                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
440                 }
441
442                 [EditorBrowsable (EditorBrowsableState.Advanced)]
443                 protected static object GetIFontDispFromFont (Font font)
444                 {
445                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
446                 }
447
448                 [EditorBrowsable (EditorBrowsableState.Advanced)]
449                 protected static object GetIFontFromFont (Font font)
450                 {
451                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
452                 }
453
454                 [EditorBrowsable (EditorBrowsableState.Advanced)]
455                 protected static object GetIPictureDispFromPicture (Image image)
456                 {
457                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
458                 }
459
460                 [EditorBrowsable (EditorBrowsableState.Advanced)]
461                 protected static object GetIPictureFromCursor (Cursor cursor)
462                 {
463                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
464                 }
465
466                 [EditorBrowsable (EditorBrowsableState.Advanced)]
467                 protected static object GetIPictureFromPicture (Image image)
468                 {
469                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
470                 }
471
472                 [EditorBrowsable (EditorBrowsableState.Advanced)]
473                 protected static double GetOADateFromTime (DateTime time)
474                 {
475                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
476                 }
477
478                 [CLSCompliant(false)]
479                 [EditorBrowsable (EditorBrowsableState.Advanced)]
480                 protected static uint GetOleColorFromColor (Color color)
481                 {
482                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
483                 }
484
485                 [EditorBrowsable (EditorBrowsableState.Advanced)]
486                 protected static Image GetPictureFromIPicture (object picture)
487                 {
488                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
489                 }
490
491                 [EditorBrowsable (EditorBrowsableState.Advanced)]
492                 protected static Image GetPictureFromIPictureDisp (object picture)
493                 {
494                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
495                 }
496
497                 [EditorBrowsable (EditorBrowsableState.Advanced)]
498                 protected static DateTime GetTimeFromOADate (double date)
499                 {
500                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
501                 }
502                 #endregion      // Protected Static Methods
503
504                 #region Public Instance Methods
505                 [EditorBrowsable (EditorBrowsableState.Advanced)]
506                 [MonoTODO]
507                 public void BeginInit ()
508                 {
509                 }
510                 
511                 public void DoVerb (int verb)
512                 {
513                         throw new NotImplementedException("COM/ActiveX support is not implemented");
514                 }
515
516                 [EditorBrowsable (EditorBrowsableState.Advanced)]
517                 [MonoTODO]
518                 public void EndInit ()
519                 {
520                 }
521
522                 [EditorBrowsable (EditorBrowsableState.Advanced)]
523                 public object GetOcx ()
524                 {
525                         return instance;
526                 }
527                 
528                 public bool HasPropertyPages ()
529                 {
530                         throw new NotImplementedException("COM/ActiveX support is not implemented");
531                 }
532                 
533                 [EditorBrowsable (EditorBrowsableState.Advanced)]
534                 public void InvokeEditMode ()
535                 {
536                         throw new NotImplementedException("COM/ActiveX support is not implemented");
537                 }
538
539                 [EditorBrowsable (EditorBrowsableState.Advanced)]
540                 public void MakeDirty ()
541                 {
542                         throw new NotImplementedException("COM/ActiveX support is not implemented");
543                 }
544
545                 public override bool PreProcessMessage (ref Message msg)
546                 {
547                         throw new NotImplementedException("COM/ActiveX support is not implemented");
548                 }
549
550                 public void ShowAboutBox ()
551                 {
552                         if (aboutDelegate != null)
553                                 this.aboutDelegate();
554                 }
555                 
556                 public void ShowPropertyPages ()
557                 {
558                         throw new NotImplementedException("COM/ActiveX support is not implemented");
559                 }
560                 
561                 public void ShowPropertyPages (Control control)
562                 {
563                         throw new NotImplementedException("COM/ActiveX support is not implemented");
564                 }
565                 #endregion      // Public Instance Methods
566
567                 #region Protected Instance Methods
568                 protected virtual void AttachInterfaces ()
569                 {
570
571                 }
572                 
573                 protected override void CreateHandle ()
574                 {
575                         if(IsRunningOnWindows && !base.IsHandleCreated) {
576                                 GetActiveXInstance ();
577                                 AttachInterfaces ();
578
579                                 base.CreateHandle ();
580                         } else {
581                                 throw new NotSupportedException ();
582                         }
583                 }
584
585                 private void GetActiveXInstance()
586                 {
587                         if (this.instance == null) {
588                                 object obj;
589                                 CoCreateInstance (ref clsid, null, 1, ref IID_IUnknown, out obj);
590                                 this.instance = obj;
591                         }
592                 }
593
594                 protected virtual object CreateInstanceCore (Guid clsid)
595                 {
596                         throw new NotImplementedException("COM/ActiveX support is not implemented");
597                 }
598
599
600                 [EditorBrowsable (EditorBrowsableState.Advanced)]
601                 protected virtual void CreateSink ()
602                 {
603                         throw new NotImplementedException("COM/ActiveX support is not implemented");
604                 }
605                 
606                 protected override void DestroyHandle ()
607                 {
608                         base.DestroyHandle();
609                 }
610
611                 [EditorBrowsable (EditorBrowsableState.Advanced)]
612                 protected virtual void DetachSink ()
613                 {
614                         throw new NotImplementedException("COM/ActiveX support is not implemented");
615                 }
616
617                 protected override void Dispose (bool disposing)
618                 {
619                         if(disposing) {
620                                 if(this.instance != null)
621                                         Marshal.ReleaseComObject (this.instance);
622                                 this.instance = null;
623                         }
624                         base.Dispose(disposing);
625                 }
626
627                 [EditorBrowsable (EditorBrowsableState.Never)]
628                 public new void DrawToBitmap (Bitmap bitmap, Rectangle targetBounds)
629                 {
630                         throw new NotImplementedException("COM/ActiveX support is not implemented");
631                 }
632
633                 [EditorBrowsable (EditorBrowsableState.Advanced)]
634                 protected new virtual Rectangle GetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified)
635                 {
636                         throw new NotImplementedException("COM/ActiveX support is not implemented");
637                 }
638
639                 protected override bool IsInputChar (char charCode)
640                 {
641                         throw new NotImplementedException("COM/ActiveX support is not implemented");
642                 }
643                 
644                 protected override void OnBackColorChanged (EventArgs e)
645                 {
646                         base.OnBackColorChanged(e);
647                 }
648                 
649                 protected override void OnFontChanged (EventArgs e)
650                 {
651                         base.OnFontChanged(e);
652                 }
653                 
654                 protected override void OnForeColorChanged (EventArgs e)
655                 {
656                         base.OnForeColorChanged(e);
657                 }
658                 
659                 protected override void OnHandleCreated (EventArgs e)
660                 {
661                         throw new NotImplementedException("COM/ActiveX support is not implemented");
662                 }
663
664                 protected virtual void OnInPlaceActive ()
665                 {
666                         throw new NotImplementedException("COM/ActiveX support is not implemented");
667                 }
668                 
669                 [EditorBrowsable (EditorBrowsableState.Advanced)]
670                 protected override void OnLostFocus (EventArgs e)
671                 {
672                         throw new NotImplementedException("COM/ActiveX support is not implemented");
673                 }
674                 
675                 protected override bool ProcessDialogKey (Keys keyData)
676                 {
677                         return base.ProcessDialogKey(keyData);
678                 }
679
680                 protected override bool ProcessMnemonic (char charCode)
681                 {
682                         throw new NotImplementedException("COM/ActiveX support is not implemented");
683                 }
684
685                 [EditorBrowsable (EditorBrowsableState.Advanced)]
686                 protected bool PropsValid ()
687                 {
688                         throw new NotImplementedException("COM/ActiveX support is not implemented"); 
689                 }
690
691                 [EditorBrowsable (EditorBrowsableState.Advanced)]
692                 protected void RaiseOnMouseDown (short button, short shift, int x, int y)
693                 {
694                         throw new NotImplementedException("COM/ActiveX support is not implemented");
695                 }
696
697                 [EditorBrowsable (EditorBrowsableState.Advanced)]
698                 protected void RaiseOnMouseDown (short button, short shift, float x, float y)
699                 {
700                         throw new NotImplementedException("COM/ActiveX support is not implemented");
701                 }
702
703                 [EditorBrowsable (EditorBrowsableState.Advanced)]
704                 protected void RaiseOnMouseDown (object o1, object o2, object o3, object o4)
705                 {
706                         throw new NotImplementedException("COM/ActiveX support is not implemented");
707                 }
708
709                 [EditorBrowsable (EditorBrowsableState.Advanced)]
710                 protected void RaiseOnMouseMove (short button, short shift, int x, int y)
711                 {
712                         throw new NotImplementedException("COM/ActiveX support is not implemented");
713                 }
714
715                 [EditorBrowsable (EditorBrowsableState.Advanced)]
716                 protected void RaiseOnMouseMove (short button, short shift, float x, float y)
717                 {
718                         throw new NotImplementedException("COM/ActiveX support is not implemented");
719                 }
720
721                 [EditorBrowsable (EditorBrowsableState.Advanced)]
722                 protected void RaiseOnMouseMove (object o1, object o2, object o3, object o4)
723                 {
724                         throw new NotImplementedException("COM/ActiveX support is not implemented");
725                 }
726
727                 [EditorBrowsable (EditorBrowsableState.Advanced)]
728                 protected void RaiseOnMouseUp (short button, short shift, int x, int y)
729                 {
730                         throw new NotImplementedException("COM/ActiveX support is not implemented");
731                 }
732
733                 [EditorBrowsable (EditorBrowsableState.Advanced)]
734                 protected void RaiseOnMouseUp (short button, short shift, float x, float y)
735                 {
736                         throw new NotImplementedException("COM/ActiveX support is not implemented");
737                 }
738
739                 [EditorBrowsable (EditorBrowsableState.Advanced)]
740                 protected void RaiseOnMouseUp (object o1, object o2, object o3, object o4)
741                 {
742                         throw new NotImplementedException("COM/ActiveX support is not implemented");
743                 }
744
745                 protected void SetAboutBoxDelegate (AxHost.AboutBoxDelegate d)
746                 {
747                         this.aboutDelegate = d;
748                 }
749                 
750                 protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified)
751                 {
752                         base.SetBoundsCore(x, y, width, height, specified);
753                 }
754                 
755                 protected override void SetVisibleCore (bool value)
756                 {
757                         throw new NotImplementedException("COM/ActiveX support is not implemented");
758                 }
759                 
760                 protected override void WndProc (ref Message m)
761                 {
762                         this.DefWndProc(ref m);
763                 }
764                 #endregion      // Protected Instance Methods
765
766                 #region Events
767                 [Browsable (false)]
768                 [EditorBrowsable (EditorBrowsableState.Never)]
769                 public new event EventHandler BackColorChanged {
770                         add { throw new NotSupportedException("BackColorChanged"); }
771                         remove { }
772                 }
773
774                 [Browsable (false)]
775                 [EditorBrowsable (EditorBrowsableState.Never)]
776                 public new event EventHandler BackgroundImageChanged {
777                         add { throw new NotSupportedException("BackgroundImageChanged"); }
778                         remove { }
779                 }
780
781                 [Browsable (false)]
782                 [EditorBrowsable (EditorBrowsableState.Never)]
783                 public new event EventHandler BindingContextChanged {
784                         add { throw new NotSupportedException("BackgroundImageChanged"); }
785                         remove { }
786                 }
787
788                 [Browsable (false)]
789                 [EditorBrowsable (EditorBrowsableState.Never)]
790                 public new event UICuesEventHandler ChangeUICues {
791                         add { throw new NotSupportedException("ChangeUICues"); }
792                         remove { }
793                 }
794
795                 [Browsable (false)]
796                 [EditorBrowsable (EditorBrowsableState.Never)]
797                 public new event EventHandler Click {
798                         add { throw new NotSupportedException("Click"); }
799                         remove { }
800                 }
801
802                 [Browsable (false)]
803                 [EditorBrowsable (EditorBrowsableState.Never)]
804                 public new event EventHandler ContextMenuChanged {
805                         add { throw new NotSupportedException("ContextMenuChanged"); }
806                         remove { }
807                 }
808         
809                 [Browsable (false)]
810                 [EditorBrowsable (EditorBrowsableState.Never)]
811                 public new event EventHandler CursorChanged {
812                         add { throw new NotSupportedException("CursorChanged"); }
813                         remove { }
814                 }
815
816                 [Browsable (false)]
817                 [EditorBrowsable (EditorBrowsableState.Never)]
818                 public new event EventHandler DoubleClick {
819                         add { throw new NotSupportedException("DoubleClick"); }
820                         remove { }
821                 }
822
823                 [Browsable (false)]
824                 [EditorBrowsable (EditorBrowsableState.Never)]
825                 public new event DragEventHandler DragDrop {
826                         add { throw new NotSupportedException("DragDrop"); }
827                         remove { }
828                 }
829
830                 [Browsable (false)]
831                 [EditorBrowsable (EditorBrowsableState.Never)]
832                 public new event DragEventHandler DragEnter {
833                         add { throw new NotSupportedException("DragEnter"); }
834                         remove { }
835                 }
836
837                 [Browsable (false)]
838                 [EditorBrowsable (EditorBrowsableState.Never)]
839                 public new event EventHandler DragLeave {
840                         add { throw new NotSupportedException("DragLeave"); }
841                         remove { }
842                 }
843
844                 [Browsable (false)]
845                 [EditorBrowsable (EditorBrowsableState.Never)]
846                 public new event DragEventHandler DragOver {
847                         add { throw new NotSupportedException("DragOver"); }
848                         remove { }
849                 }
850
851                 [Browsable (false)]
852                 [EditorBrowsable (EditorBrowsableState.Never)]
853                 public new event EventHandler EnabledChanged {
854                         add { throw new NotSupportedException("EnabledChanged"); }
855                         remove { }
856                 }
857
858                 [Browsable (false)]
859                 [EditorBrowsable (EditorBrowsableState.Never)]
860                 public new event EventHandler FontChanged {
861                         add { throw new NotSupportedException("FontChanged"); }
862                         remove { }
863                 }
864
865                 [Browsable (false)]
866                 [EditorBrowsable (EditorBrowsableState.Never)]
867                 public new event EventHandler ForeColorChanged {
868                         add { throw new NotSupportedException("ForeColorChanged"); }
869                         remove { }
870                 }
871
872                 [Browsable (false)]
873                 [EditorBrowsable (EditorBrowsableState.Never)]
874                 public new event GiveFeedbackEventHandler GiveFeedback {
875                         add { throw new NotSupportedException("GiveFeedback"); }
876                         remove { }
877                 }
878
879                 [Browsable (false)]
880                 [EditorBrowsable (EditorBrowsableState.Never)]
881                 public new event HelpEventHandler HelpRequested {
882                         add { throw new NotSupportedException("HelpRequested"); }
883                         remove { }
884                 }
885
886                 [Browsable (false)]
887                 [EditorBrowsable (EditorBrowsableState.Never)]
888                 public new event EventHandler ImeModeChanged {
889                         add { throw new NotSupportedException("ImeModeChanged"); }
890                         remove { }
891                 }
892
893                 [Browsable (false)]
894                 [EditorBrowsable (EditorBrowsableState.Never)]
895                 public new event KeyEventHandler KeyDown {
896                         add { throw new NotSupportedException("KeyDown"); }
897                         remove { }
898                 }
899
900                 [Browsable (false)]
901                 [EditorBrowsable (EditorBrowsableState.Never)]
902                 public new event KeyPressEventHandler KeyPress {
903                         add { throw new NotSupportedException("KeyPress"); }
904                         remove { }
905                 }
906
907                 [Browsable (false)]
908                 [EditorBrowsable (EditorBrowsableState.Never)]
909                 public new event KeyEventHandler KeyUp {
910                         add { throw new NotSupportedException("KeyUp"); }
911                         remove { }
912                 }
913
914                 [Browsable (false)]
915                 [EditorBrowsable (EditorBrowsableState.Never)]
916                 public new event LayoutEventHandler Layout {
917                         add { throw new NotSupportedException("Layout"); }
918                         remove { }
919                 }
920
921                 [Browsable (false)]
922                 [EditorBrowsable (EditorBrowsableState.Never)]
923                 public new event MouseEventHandler MouseDown {
924                         add { throw new NotSupportedException("MouseDown"); }
925                         remove { }
926                 }
927
928                 [Browsable (false)]
929                 [EditorBrowsable (EditorBrowsableState.Never)]
930                 public new event EventHandler MouseEnter {
931                         add { throw new NotSupportedException("MouseEnter"); }
932                         remove { }
933                 }
934
935                 [Browsable (false)]
936                 [EditorBrowsable (EditorBrowsableState.Never)]
937                 public new event EventHandler MouseHover {
938                         add { throw new NotSupportedException("MouseHover"); }
939                         remove { }
940                 }
941
942                 [Browsable (false)]
943                 [EditorBrowsable (EditorBrowsableState.Never)]
944                 public new event EventHandler MouseLeave {
945                         add { throw new NotSupportedException("MouseLeave"); }
946                         remove { }
947                 }
948
949                 [Browsable (false)]
950                 [EditorBrowsable (EditorBrowsableState.Never)]
951                 public new event MouseEventHandler MouseMove {
952                         add { throw new NotSupportedException("MouseMove"); }
953                         remove { }
954                 }
955
956                 [Browsable (false)]
957                 [EditorBrowsable (EditorBrowsableState.Never)]
958                 public new event MouseEventHandler MouseUp {
959                         add { throw new NotSupportedException("MouseUp"); }
960                         remove { }
961                 }
962
963                 [Browsable (false)]
964                 [EditorBrowsable (EditorBrowsableState.Never)]
965                 public new event MouseEventHandler MouseWheel {
966                         add { throw new NotSupportedException("MouseWheel"); }
967                         remove { }
968                 }
969
970                 [Browsable (false)]
971                 [EditorBrowsable (EditorBrowsableState.Never)]
972                 public new event PaintEventHandler Paint {
973                         add { throw new NotSupportedException("Paint"); }
974                         remove { }
975                 }
976
977                 [Browsable (false)]
978                 [EditorBrowsable (EditorBrowsableState.Never)]
979                 public new event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp {
980                         add { throw new NotSupportedException("QueryAccessibilityHelp"); }
981                         remove { }
982                 }
983
984                 [Browsable (false)]
985                 [EditorBrowsable (EditorBrowsableState.Never)]
986                 public new event QueryContinueDragEventHandler QueryContinueDrag {
987                         add { throw new NotSupportedException("QueryContinueDrag"); }
988                         remove { }
989                 }
990
991                 [Browsable (false)]
992                 [EditorBrowsable (EditorBrowsableState.Never)]
993                 public new event EventHandler RightToLeftChanged {
994                         add { throw new NotSupportedException("RightToLeftChanged"); }
995                         remove { }
996                 }
997
998                 [Browsable (false)]
999                 [EditorBrowsable (EditorBrowsableState.Never)]
1000                 public new event EventHandler StyleChanged {
1001                         add { throw new NotSupportedException("StyleChanged"); }
1002                         remove { }
1003                 }
1004
1005                 [Browsable (false)]
1006                 [EditorBrowsable (EditorBrowsableState.Never)]
1007                 public new event EventHandler BackgroundImageLayoutChanged {
1008                         add { throw new NotSupportedException("BackgroundImageChanged"); }
1009                         remove { }
1010                 }
1011
1012                 [Browsable (false)]
1013                 [EditorBrowsable (EditorBrowsableState.Never)]
1014                 public new event EventHandler MouseClick {
1015                         add { throw new NotSupportedException("BackgroundImMouseClickageChanged"); }
1016                         remove { }
1017                 }
1018
1019                 [Browsable (false)]
1020                 [EditorBrowsable (EditorBrowsableState.Never)]
1021                 public new event EventHandler MouseDoubleClick {
1022                         add { throw new NotSupportedException("MouseDoubleClick"); }
1023                         remove { }
1024                 }
1025
1026                 [Browsable (false)]
1027                 [EditorBrowsable (EditorBrowsableState.Never)]
1028                 public new event EventHandler TextChanged {
1029                         add { throw new NotSupportedException("TextChanged"); }
1030                         remove { }
1031                 }
1032                 #endregion      // Events
1033
1034                 #region Delegates
1035                 protected delegate void AboutBoxDelegate ();
1036                 #endregion      // Delegates
1037
1038                 #region Interfaces
1039                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1040                 AttributeCollection ICustomTypeDescriptor.GetAttributes ()
1041                 {
1042                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1043                 }
1044                 
1045                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1046                 string ICustomTypeDescriptor.GetClassName ()
1047                 {
1048                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1049                 }
1050                 
1051                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1052                 string ICustomTypeDescriptor.GetComponentName ()
1053                 {
1054                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1055                 }
1056                 
1057                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1058                 TypeConverter ICustomTypeDescriptor.GetConverter ()
1059                 {
1060                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1061                 }
1062                 
1063                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1064                 EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
1065                 {
1066                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1067                 }
1068                 
1069                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1070                 PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
1071                 {
1072                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1073                 }
1074                 
1075                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1076                 object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
1077                 {
1078                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1079                 }
1080                 
1081                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1082                 EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
1083                 {
1084                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1085                 }
1086                 
1087                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1088                 EventDescriptorCollection ICustomTypeDescriptor.GetEvents (Attribute[] attributes)
1089                 {
1090                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1091                 }
1092                 
1093                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1094                 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
1095                 {
1096                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1097                 }
1098                 
1099                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1100                 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute[] attributes)
1101                 {
1102                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1103                 }
1104                 
1105                 [EditorBrowsable (EditorBrowsableState.Advanced)]
1106                 object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
1107                 {
1108                         throw new NotImplementedException("COM/ActiveX support is not implemented");
1109                 }
1110                 #endregion      // Interfaces
1111
1112                 internal static bool IsRunningOnWindows {
1113                         get { return runningOnWindows; }
1114                 }
1115
1116                 static Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
1117
1118                 [DllImport("ole32.dll")]
1119                 static extern int CoCreateInstance (
1120                         [In] ref Guid rclsid,
1121                         [In, MarshalAs (UnmanagedType.IUnknown)] object pUnkOuter,
1122                         [In] uint dwClsContext,
1123                         [In] ref Guid riid,
1124                         [Out, MarshalAs (UnmanagedType.Interface)] out object ppv);
1125
1126         }
1127 }