[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / class / System.Windows.Forms / System.Windows.Forms / AxHost.cs
blob2a917e23ecbff03223ff22cd4242d1a31b0205b2
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.
20 // Copyright (c) 2005 Novell, Inc. (http://www.novell.com)
22 // Authors:
23 // Peter Bartok <pbartok@novell.com>
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;
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
50 #endregion // AxHost.ActiveXInvokeKind Enum
52 #region AxHost.AxComponentEditor Class
53 [ComVisible (false)]
54 public class AxComponentEditor : System.Windows.Forms.Design.WindowsFormsComponentEditor {
55 public AxComponentEditor ()
57 throw new NotImplementedException("COM/ActiveX support is not implemented");
60 public override bool EditComponent (ITypeDescriptorContext context, object obj, IWin32Window parent)
62 throw new NotImplementedException("COM/ActiveX support is not implemented");
65 #endregion // AxHost.AxComponentEditor Class
67 #region AxHost.ClsidAttribute
68 [AttributeUsage(AttributeTargets.Class,Inherited=false)]
69 public sealed class ClsidAttribute : Attribute {
70 string clsid;
72 public ClsidAttribute (string clsid)
74 this.clsid = clsid;
77 public string Value {
78 get { return clsid; }
81 #endregion AxHost.ClsidAttribute
83 #region AxHost.ConnectionPointCookie
84 public class ConnectionPointCookie {
85 public ConnectionPointCookie (object source, object sink, Type eventInterface)
87 throw new NotImplementedException("COM/ActiveX support is not implemented");
90 public void Disconnect ()
92 throw new NotImplementedException("COM/ActiveX support is not implemented");
95 ~ConnectionPointCookie ()
97 throw new NotImplementedException("COM/ActiveX support is not implemented");
100 #endregion // AxHost.ConnectionPointCookie
102 #region AxHost.InvalidActiveXStateException Class
103 public class InvalidActiveXStateException : Exception {
104 private string mName;
105 private ActiveXInvokeKind mKind;
107 public InvalidActiveXStateException ()
112 public InvalidActiveXStateException (string name, ActiveXInvokeKind kind)
114 mName = name;
115 mKind = kind;
118 public override string ToString ()
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;
127 return base.ToString();
130 #endregion // AxHost.InvalidActiveXStateException Class
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)
138 //throw new NotImplementedException("COM/ActiveX support is not implemented");
141 protected State (SerializationInfo info, StreamingContext context)
145 void ISerializable.GetObjectData (SerializationInfo si,StreamingContext context)
147 //throw new NotImplementedException("COM/ActiveX support is not implemented");
150 #endregion // AxHost.State Class
152 #region AxHost.TypeLibraryTimeStampAttribute Class
153 [AttributeUsage(AttributeTargets.Assembly, Inherited=false)]
154 public sealed class TypeLibraryTimeStampAttribute : Attribute {
155 public TypeLibraryTimeStampAttribute (string timestamp)
157 throw new NotImplementedException("COM/ActiveX support is not implemented");
160 public DateTime Value {
161 get {
162 throw new NotImplementedException("COM/ActiveX support is not implemented");
166 #endregion // AxHost.TypeLibraryTimeStampAttribute Class
168 #region AxHost.StateConverter Class
169 public class StateConverter : System.ComponentModel.TypeConverter {
170 public StateConverter ()
172 throw new NotImplementedException("COM/ActiveX support is not implemented");
175 public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType)
177 throw new NotImplementedException("COM/ActiveX support is not implemented");
180 public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType)
182 throw new NotImplementedException("COM/ActiveX support is not implemented");
185 public override object ConvertFrom (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value)
187 throw new NotImplementedException("COM/ActiveX support is not implemented");
190 public override object ConvertTo (ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType)
192 throw new NotImplementedException("COM/ActiveX support is not implemented");
195 #endregion // AxHost.StateConverter Class
196 #endregion // AxHost Subclasses
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;
205 #region Protected Constructors
207 protected AxHost (string clsid) : this(clsid, 0)
212 protected AxHost (string clsid, int flags)
214 this.clsid = new Guid(clsid);
215 //this.flags = flags;
216 this.instance = null;
218 PlatformID pid = Environment.OSVersion.Platform;
219 runningOnWindows = ((int) pid != 128 && (int) pid != 4 && (int) pid != 6);
221 #endregion // Public Instance Properties
223 #region Public Instance Properties
224 [Browsable (false)]
225 [EditorBrowsable (EditorBrowsableState.Never)]
226 public override Color BackColor {
227 get {
228 return base.BackColor;
230 set {
231 base.BackColor = value;
235 [Browsable (false)]
236 [EditorBrowsable (EditorBrowsableState.Never)]
237 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
238 public override Image BackgroundImage {
239 get {
240 return base.BackgroundImage;
243 set {
244 base.BackgroundImage = value;
248 [Browsable (false)]
249 [EditorBrowsable (EditorBrowsableState.Never)]
250 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
251 public override ImageLayout BackgroundImageLayout {
252 get {
253 return base.BackgroundImageLayout;
256 set {
257 base.BackgroundImageLayout = value;
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");
269 set {
270 throw new NotImplementedException("COM/ActiveX support is not implemented");
274 [Browsable (false)]
275 [EditorBrowsable (EditorBrowsableState.Never)]
276 public override ContextMenu ContextMenu {
277 get {
278 return base.ContextMenu;
281 set {
282 base.ContextMenu = value;
286 [Browsable (false)]
287 [EditorBrowsable (EditorBrowsableState.Never)]
288 public override Cursor Cursor {
289 get {
290 return base.Cursor;
293 set {
294 base.Cursor = value;
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");
307 [Browsable (false)]
308 [EditorBrowsable (EditorBrowsableState.Never)]
309 public new virtual bool Enabled {
310 get {
311 return base.Enabled;
314 set {
315 base.Enabled = value;
319 [Browsable (false)]
320 [EditorBrowsable (EditorBrowsableState.Never)]
321 public override Font Font {
322 get {
323 return base.Font;
326 set {
327 base.Font = value;
331 [Browsable (false)]
332 [EditorBrowsable (EditorBrowsableState.Never)]
333 public override Color ForeColor {
334 get {
335 return base.ForeColor;
338 set {
339 base.ForeColor = value;
343 [Browsable (false)]
344 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
345 [EditorBrowsable (EditorBrowsableState.Advanced)]
346 public bool HasAboutBox {
347 get {
348 return aboutDelegate != null;
352 [Browsable (false)]
353 [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
354 [EditorBrowsable (EditorBrowsableState.Never)]
355 public new ImeMode ImeMode {
356 get {
357 return base.ImeMode;
359 set {
360 base.ImeMode = value;
364 [Browsable (false)]
365 [DefaultValue (null)]
366 [EditorBrowsable (EditorBrowsableState.Advanced)]
367 [RefreshProperties (RefreshProperties.All)]
368 public AxHost.State OcxState {
369 get {
370 return ocxState;
373 set {
374 if (ocxState == value || value == null)
376 return;
378 this.ocxState = value;
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;
390 set {
391 base.RightToLeft = (value ? System.Windows.Forms.RightToLeft.Yes :
392 System.Windows.Forms.RightToLeft.No);
396 public override ISite Site {
397 set {
398 throw new NotImplementedException("COM/ActiveX support is not implemented");
402 [Browsable (false)]
403 [EditorBrowsable (EditorBrowsableState.Never)]
404 public override string Text {
405 get { return base.Text; }
406 set { base.Text = value; }
408 #endregion // Protected Constructors
410 #region Protected Instance Properties
411 protected override CreateParams CreateParams {
412 get { return base.CreateParams; }
415 protected override Size DefaultSize {
416 get {
417 return new Size (75, 23);
420 #endregion // Protected Instance Properties
422 #region Protected Static Methods
423 [CLSCompliant(false)]
424 [EditorBrowsable (EditorBrowsableState.Advanced)]
425 protected static Color GetColorFromOleColor (uint color)
427 throw new NotImplementedException("COM/ActiveX support is not implemented");
430 [EditorBrowsable (EditorBrowsableState.Advanced)]
431 protected static Font GetFontFromIFont (object font)
433 throw new NotImplementedException("COM/ActiveX support is not implemented");
436 [EditorBrowsable (EditorBrowsableState.Advanced)]
437 protected static Font GetFontFromIFontDisp (object font)
439 throw new NotImplementedException("COM/ActiveX support is not implemented");
442 [EditorBrowsable (EditorBrowsableState.Advanced)]
443 protected static object GetIFontDispFromFont (Font font)
445 throw new NotImplementedException("COM/ActiveX support is not implemented");
448 [EditorBrowsable (EditorBrowsableState.Advanced)]
449 protected static object GetIFontFromFont (Font font)
451 throw new NotImplementedException("COM/ActiveX support is not implemented");
454 [EditorBrowsable (EditorBrowsableState.Advanced)]
455 protected static object GetIPictureDispFromPicture (Image image)
457 throw new NotImplementedException("COM/ActiveX support is not implemented");
460 [EditorBrowsable (EditorBrowsableState.Advanced)]
461 protected static object GetIPictureFromCursor (Cursor cursor)
463 throw new NotImplementedException("COM/ActiveX support is not implemented");
466 [EditorBrowsable (EditorBrowsableState.Advanced)]
467 protected static object GetIPictureFromPicture (Image image)
469 throw new NotImplementedException("COM/ActiveX support is not implemented");
472 [EditorBrowsable (EditorBrowsableState.Advanced)]
473 protected static double GetOADateFromTime (DateTime time)
475 throw new NotImplementedException("COM/ActiveX support is not implemented");
478 [CLSCompliant(false)]
479 [EditorBrowsable (EditorBrowsableState.Advanced)]
480 protected static uint GetOleColorFromColor (Color color)
482 throw new NotImplementedException("COM/ActiveX support is not implemented");
485 [EditorBrowsable (EditorBrowsableState.Advanced)]
486 protected static Image GetPictureFromIPicture (object picture)
488 throw new NotImplementedException("COM/ActiveX support is not implemented");
491 [EditorBrowsable (EditorBrowsableState.Advanced)]
492 protected static Image GetPictureFromIPictureDisp (object picture)
494 throw new NotImplementedException("COM/ActiveX support is not implemented");
497 [EditorBrowsable (EditorBrowsableState.Advanced)]
498 protected static DateTime GetTimeFromOADate (double date)
500 throw new NotImplementedException("COM/ActiveX support is not implemented");
502 #endregion // Protected Static Methods
504 #region Public Instance Methods
505 [EditorBrowsable (EditorBrowsableState.Advanced)]
506 [MonoTODO]
507 public void BeginInit ()
511 public void DoVerb (int verb)
513 throw new NotImplementedException("COM/ActiveX support is not implemented");
516 [EditorBrowsable (EditorBrowsableState.Advanced)]
517 [MonoTODO]
518 public void EndInit ()
522 [EditorBrowsable (EditorBrowsableState.Advanced)]
523 public object GetOcx ()
525 return instance;
528 public bool HasPropertyPages ()
530 throw new NotImplementedException("COM/ActiveX support is not implemented");
533 [EditorBrowsable (EditorBrowsableState.Advanced)]
534 public void InvokeEditMode ()
536 throw new NotImplementedException("COM/ActiveX support is not implemented");
539 [EditorBrowsable (EditorBrowsableState.Advanced)]
540 public void MakeDirty ()
542 throw new NotImplementedException("COM/ActiveX support is not implemented");
545 public override bool PreProcessMessage (ref Message msg)
547 throw new NotImplementedException("COM/ActiveX support is not implemented");
550 public void ShowAboutBox ()
552 if (aboutDelegate != null)
553 this.aboutDelegate();
556 public void ShowPropertyPages ()
558 throw new NotImplementedException("COM/ActiveX support is not implemented");
561 public void ShowPropertyPages (Control control)
563 throw new NotImplementedException("COM/ActiveX support is not implemented");
565 #endregion // Public Instance Methods
567 #region Protected Instance Methods
568 protected virtual void AttachInterfaces ()
573 protected override void CreateHandle ()
575 if(IsRunningOnWindows && !base.IsHandleCreated) {
576 GetActiveXInstance ();
577 AttachInterfaces ();
579 base.CreateHandle ();
580 } else {
581 throw new NotSupportedException ();
585 private void GetActiveXInstance()
587 if (this.instance == null) {
588 object obj;
589 CoCreateInstance (ref clsid, null, 1, ref IID_IUnknown, out obj);
590 this.instance = obj;
594 protected virtual object CreateInstanceCore (Guid clsid)
596 throw new NotImplementedException("COM/ActiveX support is not implemented");
600 [EditorBrowsable (EditorBrowsableState.Advanced)]
601 protected virtual void CreateSink ()
603 throw new NotImplementedException("COM/ActiveX support is not implemented");
606 protected override void DestroyHandle ()
608 base.DestroyHandle();
611 [EditorBrowsable (EditorBrowsableState.Advanced)]
612 protected virtual void DetachSink ()
614 throw new NotImplementedException("COM/ActiveX support is not implemented");
617 protected override void Dispose (bool disposing)
619 if(disposing) {
620 if(this.instance != null)
621 Marshal.ReleaseComObject (this.instance);
622 this.instance = null;
624 base.Dispose(disposing);
627 [EditorBrowsable (EditorBrowsableState.Never)]
628 public new void DrawToBitmap (Bitmap bitmap, Rectangle targetBounds)
630 throw new NotImplementedException("COM/ActiveX support is not implemented");
633 [EditorBrowsable (EditorBrowsableState.Advanced)]
634 protected new virtual Rectangle GetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified)
636 throw new NotImplementedException("COM/ActiveX support is not implemented");
639 protected override bool IsInputChar (char charCode)
641 throw new NotImplementedException("COM/ActiveX support is not implemented");
644 protected override void OnBackColorChanged (EventArgs e)
646 base.OnBackColorChanged(e);
649 protected override void OnFontChanged (EventArgs e)
651 base.OnFontChanged(e);
654 protected override void OnForeColorChanged (EventArgs e)
656 base.OnForeColorChanged(e);
659 protected override void OnHandleCreated (EventArgs e)
661 throw new NotImplementedException("COM/ActiveX support is not implemented");
664 protected virtual void OnInPlaceActive ()
666 throw new NotImplementedException("COM/ActiveX support is not implemented");
669 [EditorBrowsable (EditorBrowsableState.Advanced)]
670 protected override void OnLostFocus (EventArgs e)
672 throw new NotImplementedException("COM/ActiveX support is not implemented");
675 protected override bool ProcessDialogKey (Keys keyData)
677 return base.ProcessDialogKey(keyData);
680 protected override bool ProcessMnemonic (char charCode)
682 throw new NotImplementedException("COM/ActiveX support is not implemented");
685 [EditorBrowsable (EditorBrowsableState.Advanced)]
686 protected bool PropsValid ()
688 throw new NotImplementedException("COM/ActiveX support is not implemented");
691 [EditorBrowsable (EditorBrowsableState.Advanced)]
692 protected void RaiseOnMouseDown (short button, short shift, int x, int y)
694 throw new NotImplementedException("COM/ActiveX support is not implemented");
697 [EditorBrowsable (EditorBrowsableState.Advanced)]
698 protected void RaiseOnMouseDown (short button, short shift, float x, float y)
700 throw new NotImplementedException("COM/ActiveX support is not implemented");
703 [EditorBrowsable (EditorBrowsableState.Advanced)]
704 protected void RaiseOnMouseDown (object o1, object o2, object o3, object o4)
706 throw new NotImplementedException("COM/ActiveX support is not implemented");
709 [EditorBrowsable (EditorBrowsableState.Advanced)]
710 protected void RaiseOnMouseMove (short button, short shift, int x, int y)
712 throw new NotImplementedException("COM/ActiveX support is not implemented");
715 [EditorBrowsable (EditorBrowsableState.Advanced)]
716 protected void RaiseOnMouseMove (short button, short shift, float x, float y)
718 throw new NotImplementedException("COM/ActiveX support is not implemented");
721 [EditorBrowsable (EditorBrowsableState.Advanced)]
722 protected void RaiseOnMouseMove (object o1, object o2, object o3, object o4)
724 throw new NotImplementedException("COM/ActiveX support is not implemented");
727 [EditorBrowsable (EditorBrowsableState.Advanced)]
728 protected void RaiseOnMouseUp (short button, short shift, int x, int y)
730 throw new NotImplementedException("COM/ActiveX support is not implemented");
733 [EditorBrowsable (EditorBrowsableState.Advanced)]
734 protected void RaiseOnMouseUp (short button, short shift, float x, float y)
736 throw new NotImplementedException("COM/ActiveX support is not implemented");
739 [EditorBrowsable (EditorBrowsableState.Advanced)]
740 protected void RaiseOnMouseUp (object o1, object o2, object o3, object o4)
742 throw new NotImplementedException("COM/ActiveX support is not implemented");
745 protected void SetAboutBoxDelegate (AxHost.AboutBoxDelegate d)
747 this.aboutDelegate = d;
750 protected override void SetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified)
752 base.SetBoundsCore(x, y, width, height, specified);
755 protected override void SetVisibleCore (bool value)
757 throw new NotImplementedException("COM/ActiveX support is not implemented");
760 protected override void WndProc (ref Message m)
762 this.DefWndProc(ref m);
764 #endregion // Protected Instance Methods
766 #region Events
767 [Browsable (false)]
768 [EditorBrowsable (EditorBrowsableState.Never)]
769 public new event EventHandler BackColorChanged {
770 add { throw new NotSupportedException("BackColorChanged"); }
771 remove { }
774 [Browsable (false)]
775 [EditorBrowsable (EditorBrowsableState.Never)]
776 public new event EventHandler BackgroundImageChanged {
777 add { throw new NotSupportedException("BackgroundImageChanged"); }
778 remove { }
781 [Browsable (false)]
782 [EditorBrowsable (EditorBrowsableState.Never)]
783 public new event EventHandler BindingContextChanged {
784 add { throw new NotSupportedException("BackgroundImageChanged"); }
785 remove { }
788 [Browsable (false)]
789 [EditorBrowsable (EditorBrowsableState.Never)]
790 public new event UICuesEventHandler ChangeUICues {
791 add { throw new NotSupportedException("ChangeUICues"); }
792 remove { }
795 [Browsable (false)]
796 [EditorBrowsable (EditorBrowsableState.Never)]
797 public new event EventHandler Click {
798 add { throw new NotSupportedException("Click"); }
799 remove { }
802 [Browsable (false)]
803 [EditorBrowsable (EditorBrowsableState.Never)]
804 public new event EventHandler ContextMenuChanged {
805 add { throw new NotSupportedException("ContextMenuChanged"); }
806 remove { }
809 [Browsable (false)]
810 [EditorBrowsable (EditorBrowsableState.Never)]
811 public new event EventHandler CursorChanged {
812 add { throw new NotSupportedException("CursorChanged"); }
813 remove { }
816 [Browsable (false)]
817 [EditorBrowsable (EditorBrowsableState.Never)]
818 public new event EventHandler DoubleClick {
819 add { throw new NotSupportedException("DoubleClick"); }
820 remove { }
823 [Browsable (false)]
824 [EditorBrowsable (EditorBrowsableState.Never)]
825 public new event DragEventHandler DragDrop {
826 add { throw new NotSupportedException("DragDrop"); }
827 remove { }
830 [Browsable (false)]
831 [EditorBrowsable (EditorBrowsableState.Never)]
832 public new event DragEventHandler DragEnter {
833 add { throw new NotSupportedException("DragEnter"); }
834 remove { }
837 [Browsable (false)]
838 [EditorBrowsable (EditorBrowsableState.Never)]
839 public new event EventHandler DragLeave {
840 add { throw new NotSupportedException("DragLeave"); }
841 remove { }
844 [Browsable (false)]
845 [EditorBrowsable (EditorBrowsableState.Never)]
846 public new event DragEventHandler DragOver {
847 add { throw new NotSupportedException("DragOver"); }
848 remove { }
851 [Browsable (false)]
852 [EditorBrowsable (EditorBrowsableState.Never)]
853 public new event EventHandler EnabledChanged {
854 add { throw new NotSupportedException("EnabledChanged"); }
855 remove { }
858 [Browsable (false)]
859 [EditorBrowsable (EditorBrowsableState.Never)]
860 public new event EventHandler FontChanged {
861 add { throw new NotSupportedException("FontChanged"); }
862 remove { }
865 [Browsable (false)]
866 [EditorBrowsable (EditorBrowsableState.Never)]
867 public new event EventHandler ForeColorChanged {
868 add { throw new NotSupportedException("ForeColorChanged"); }
869 remove { }
872 [Browsable (false)]
873 [EditorBrowsable (EditorBrowsableState.Never)]
874 public new event GiveFeedbackEventHandler GiveFeedback {
875 add { throw new NotSupportedException("GiveFeedback"); }
876 remove { }
879 [Browsable (false)]
880 [EditorBrowsable (EditorBrowsableState.Never)]
881 public new event HelpEventHandler HelpRequested {
882 add { throw new NotSupportedException("HelpRequested"); }
883 remove { }
886 [Browsable (false)]
887 [EditorBrowsable (EditorBrowsableState.Never)]
888 public new event EventHandler ImeModeChanged {
889 add { throw new NotSupportedException("ImeModeChanged"); }
890 remove { }
893 [Browsable (false)]
894 [EditorBrowsable (EditorBrowsableState.Never)]
895 public new event KeyEventHandler KeyDown {
896 add { throw new NotSupportedException("KeyDown"); }
897 remove { }
900 [Browsable (false)]
901 [EditorBrowsable (EditorBrowsableState.Never)]
902 public new event KeyPressEventHandler KeyPress {
903 add { throw new NotSupportedException("KeyPress"); }
904 remove { }
907 [Browsable (false)]
908 [EditorBrowsable (EditorBrowsableState.Never)]
909 public new event KeyEventHandler KeyUp {
910 add { throw new NotSupportedException("KeyUp"); }
911 remove { }
914 [Browsable (false)]
915 [EditorBrowsable (EditorBrowsableState.Never)]
916 public new event LayoutEventHandler Layout {
917 add { throw new NotSupportedException("Layout"); }
918 remove { }
921 [Browsable (false)]
922 [EditorBrowsable (EditorBrowsableState.Never)]
923 public new event MouseEventHandler MouseDown {
924 add { throw new NotSupportedException("MouseDown"); }
925 remove { }
928 [Browsable (false)]
929 [EditorBrowsable (EditorBrowsableState.Never)]
930 public new event EventHandler MouseEnter {
931 add { throw new NotSupportedException("MouseEnter"); }
932 remove { }
935 [Browsable (false)]
936 [EditorBrowsable (EditorBrowsableState.Never)]
937 public new event EventHandler MouseHover {
938 add { throw new NotSupportedException("MouseHover"); }
939 remove { }
942 [Browsable (false)]
943 [EditorBrowsable (EditorBrowsableState.Never)]
944 public new event EventHandler MouseLeave {
945 add { throw new NotSupportedException("MouseLeave"); }
946 remove { }
949 [Browsable (false)]
950 [EditorBrowsable (EditorBrowsableState.Never)]
951 public new event MouseEventHandler MouseMove {
952 add { throw new NotSupportedException("MouseMove"); }
953 remove { }
956 [Browsable (false)]
957 [EditorBrowsable (EditorBrowsableState.Never)]
958 public new event MouseEventHandler MouseUp {
959 add { throw new NotSupportedException("MouseUp"); }
960 remove { }
963 [Browsable (false)]
964 [EditorBrowsable (EditorBrowsableState.Never)]
965 public new event MouseEventHandler MouseWheel {
966 add { throw new NotSupportedException("MouseWheel"); }
967 remove { }
970 [Browsable (false)]
971 [EditorBrowsable (EditorBrowsableState.Never)]
972 public new event PaintEventHandler Paint {
973 add { throw new NotSupportedException("Paint"); }
974 remove { }
977 [Browsable (false)]
978 [EditorBrowsable (EditorBrowsableState.Never)]
979 public new event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp {
980 add { throw new NotSupportedException("QueryAccessibilityHelp"); }
981 remove { }
984 [Browsable (false)]
985 [EditorBrowsable (EditorBrowsableState.Never)]
986 public new event QueryContinueDragEventHandler QueryContinueDrag {
987 add { throw new NotSupportedException("QueryContinueDrag"); }
988 remove { }
991 [Browsable (false)]
992 [EditorBrowsable (EditorBrowsableState.Never)]
993 public new event EventHandler RightToLeftChanged {
994 add { throw new NotSupportedException("RightToLeftChanged"); }
995 remove { }
998 [Browsable (false)]
999 [EditorBrowsable (EditorBrowsableState.Never)]
1000 public new event EventHandler StyleChanged {
1001 add { throw new NotSupportedException("StyleChanged"); }
1002 remove { }
1005 [Browsable (false)]
1006 [EditorBrowsable (EditorBrowsableState.Never)]
1007 public new event EventHandler BackgroundImageLayoutChanged {
1008 add { throw new NotSupportedException("BackgroundImageChanged"); }
1009 remove { }
1012 [Browsable (false)]
1013 [EditorBrowsable (EditorBrowsableState.Never)]
1014 public new event EventHandler MouseClick {
1015 add { throw new NotSupportedException("BackgroundImMouseClickageChanged"); }
1016 remove { }
1019 [Browsable (false)]
1020 [EditorBrowsable (EditorBrowsableState.Never)]
1021 public new event EventHandler MouseDoubleClick {
1022 add { throw new NotSupportedException("MouseDoubleClick"); }
1023 remove { }
1026 [Browsable (false)]
1027 [EditorBrowsable (EditorBrowsableState.Never)]
1028 public new event EventHandler TextChanged {
1029 add { throw new NotSupportedException("TextChanged"); }
1030 remove { }
1032 #endregion // Events
1034 #region Delegates
1035 protected delegate void AboutBoxDelegate ();
1036 #endregion // Delegates
1038 #region Interfaces
1039 [EditorBrowsable (EditorBrowsableState.Advanced)]
1040 AttributeCollection ICustomTypeDescriptor.GetAttributes ()
1042 throw new NotImplementedException("COM/ActiveX support is not implemented");
1045 [EditorBrowsable (EditorBrowsableState.Advanced)]
1046 string ICustomTypeDescriptor.GetClassName ()
1048 throw new NotImplementedException("COM/ActiveX support is not implemented");
1051 [EditorBrowsable (EditorBrowsableState.Advanced)]
1052 string ICustomTypeDescriptor.GetComponentName ()
1054 throw new NotImplementedException("COM/ActiveX support is not implemented");
1057 [EditorBrowsable (EditorBrowsableState.Advanced)]
1058 TypeConverter ICustomTypeDescriptor.GetConverter ()
1060 throw new NotImplementedException("COM/ActiveX support is not implemented");
1063 [EditorBrowsable (EditorBrowsableState.Advanced)]
1064 EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
1066 throw new NotImplementedException("COM/ActiveX support is not implemented");
1069 [EditorBrowsable (EditorBrowsableState.Advanced)]
1070 PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
1072 throw new NotImplementedException("COM/ActiveX support is not implemented");
1075 [EditorBrowsable (EditorBrowsableState.Advanced)]
1076 object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
1078 throw new NotImplementedException("COM/ActiveX support is not implemented");
1081 [EditorBrowsable (EditorBrowsableState.Advanced)]
1082 EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
1084 throw new NotImplementedException("COM/ActiveX support is not implemented");
1087 [EditorBrowsable (EditorBrowsableState.Advanced)]
1088 EventDescriptorCollection ICustomTypeDescriptor.GetEvents (Attribute[] attributes)
1090 throw new NotImplementedException("COM/ActiveX support is not implemented");
1093 [EditorBrowsable (EditorBrowsableState.Advanced)]
1094 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
1096 throw new NotImplementedException("COM/ActiveX support is not implemented");
1099 [EditorBrowsable (EditorBrowsableState.Advanced)]
1100 PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute[] attributes)
1102 throw new NotImplementedException("COM/ActiveX support is not implemented");
1105 [EditorBrowsable (EditorBrowsableState.Advanced)]
1106 object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
1108 throw new NotImplementedException("COM/ActiveX support is not implemented");
1110 #endregion // Interfaces
1112 internal static bool IsRunningOnWindows {
1113 get { return runningOnWindows; }
1116 static Guid IID_IUnknown = new Guid("00000000-0000-0000-C000-000000000046");
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);