DekGenius.com
[ Team LiB ] Previous Section Next Section

AxHostmarshal by reference, disposable

System.Windows.Forms (system.windows.forms.dll)abstract class

This Control class wraps ActiveX controls that have been imported into the managed environment (either by use of the Aximp.exe tool or, more commonly, by adding them to the designer by customizing the toolbox). It extends the base services to provide methods to get the underlying OCX control (GetOcx()) and show property pages (ShowPropertyPages()), if they are present (HasPropertyPages()).

Note that several of the events you would normally expect from a Control are not supported (e.g., color and font property changes), and attempting to bind to them will cause a NotSupportedException. The Liskov substitution principle states that you should be able to use any instance of a derived class in place of an instance of the base class. Throwing that exception means that this class violates that principle. Therefore, you have to take care if you are using Control objects polymorphically in your application (e.g., in your own custom host), in case someone drops an ActiveX control into the equation.

public abstract class AxHost : Control : 
System.ComponentModel.ISupportInitialize, System.ComponentModel.ICustomTypeDescriptor {
// Protected Constructors
   protected AxHost(string clsid);
   protected AxHost(string clsid, int flags);
// Public Instance Properties
   public override Color BackColor{set; get; } // overrides Control
   public override Image BackgroundImage{set; get; } // overrides Control
   public ContainerControl ContainingControl{set; get; }
   public override ContextMenu ContextMenu{set; get; } // overrides Control
   public override Cursor Cursor{set; get; } // overrides Control
   public bool EditMode{get; }
   public virtual bool Enabled{set; get; } // overrides Control
   public override Font Font{set; get; } // overrides Control
   public override Color ForeColor{set; get; } // overrides Control
   public bool HasAboutBox{get; }
   public State OcxState{set; get; }
   public virtual bool RightToLeft{set; get; }
   public override ISite Site{set; } // overrides Control
   public override string Text{set; get; } // overrides Control
// Protected Instance Properties
   protected override CreateParams CreateParams{get; } // overrides Control
   protected override Size DefaultSize{get; } // overrides Control
// Protected Static Methods
   protected static Color GetColorFromOleColor(uint color);
   protected static Font GetFontFromIFont(object font);
   protected static Font GetFontFromIFontDisp(object font);
   protected static object GetIFontDispFromFont(System.Drawing.Font font);
   protected static object GetIFontFromFont(System.Drawing.Font font);
   protected static object GetIPictureDispFromPicture(System.Drawing.Image image);
   protected static object GetIPictureFromCursor(Cursor cursor);
   protected static object GetIPictureFromPicture(System.Drawing.Image image);
   protected static double GetOADateFromTime(DateTime time);
   protected static uint GetOleColorFromColor(System.Drawing.Color color);
   protected static Image GetPictureFromIPicture(object picture);
   protected static Image GetPictureFromIPictureDisp(object picture);
   protected static DateTime GetTimeFromOADate(double date);
// Public Instance Methods
   public void BeginInit();  // implements System.ComponentModel.ISupportInitialize
   public void DoVerb(int verb);
   public void EndInit();  // implements System.ComponentModel.ISupportInitialize
   public object GetOcx();
   public bool HasPropertyPages();
   public void InvokeEditMode();
   public void MakeDirty();
   public override bool PreProcessMessage(ref Message msg);  // overrides Control
   public void ShowAboutBox();
   public void ShowPropertyPages();
   public void ShowPropertyPages(Control control);
// Protected Instance Methods
   protected virtual void AttachInterfaces();
   protected override void CreateHandle();  // overrides Control
   protected virtual void CreateSink();
   protected override void DestroyHandle();  // overrides Control
   protected virtual void DetachSink();
   protected override void Dispose(bool disposing);  // overrides Control
   protected override bool IsInputChar(char charCode);  // overrides Control
   protected override void OnBackColorChanged(EventArgs e);  // overrides Control
   protected override void OnFontChanged(EventArgs e);  // overrides Control
   protected override void OnForeColorChanged(EventArgs e);  // overrides Control
   protected override void OnHandleCreated(EventArgs e);  // overrides Control
   protected virtual void OnInPlaceActive();
   protected override void OnLostFocus(EventArgs e);  // overrides Control
   protected override bool ProcessMnemonic(char charCode);  // overrides Control
   protected bool PropsValid();
   protected void RaiseOnMouseDown(short button, short shift, int x, int y);
   protected void RaiseOnMouseDown(short button, short shift, float x, float y);
   protected void RaiseOnMouseDown(object o1, object o2, object o3, object o4);
   protected void RaiseOnMouseMove(short button, short shift, int x, int y);
   protected void RaiseOnMouseMove(short button, short shift, float x, float y);
   protected void RaiseOnMouseMove(object o1, object o2, object o3, object o4);
   protected void RaiseOnMouseUp(short button, short shift, int x, int y);
   protected void RaiseOnMouseUp(short button, short shift, float x, float y);
   protected void RaiseOnMouseUp(object o1, object o2, object o3, object o4);
   protected void SetAboutBoxDelegate(AboutBoxDelegate d);
   protected override void SetBoundsCore(int x, int y, int width, int height, BoundsSpecified specified);  // overrides Control
   protected override void SetVisibleCore(bool value);  // overrides Control
   protected override void WndProc(ref Message m);  // overrides Control
// Events
   public event EventHandler BackColorChanged; // overrides Control
   public event EventHandler BackgroundImageChanged; // overrides Control
   public event EventHandler BindingContextChanged; // overrides Control
   public event UICuesEventHandler ChangeUICues; // overrides Control
   public event EventHandler Click; // overrides Control
   public event EventHandler ContextMenuChanged; // overrides Control
   public event EventHandler CursorChanged; // overrides Control
   public event EventHandler DoubleClick; // overrides Control
   public event DragEventHandler DragDrop; // overrides Control
   public event DragEventHandler DragEnter; // overrides Control
   public event EventHandler DragLeave; // overrides Control
   public event DragEventHandler DragOver; // overrides Control
   public event EventHandler EnabledChanged; // overrides Control
   public event EventHandler FontChanged; // overrides Control
   public event EventHandler ForeColorChanged; // overrides Control
   public event GiveFeedbackEventHandler GiveFeedback; // overrides Control
   public event HelpEventHandler HelpRequested; // overrides Control
   public event EventHandler ImeModeChanged; // overrides Control
   public event KeyEventHandler KeyDown; // overrides Control
   public event KeyPressEventHandler KeyPress; // overrides Control
   public event KeyEventHandler KeyUp; // overrides Control
   public event LayoutEventHandler Layout; // overrides Control
   public event MouseEventHandler MouseDown; // overrides Control
   public event EventHandler MouseEnter; // overrides Control
   public event EventHandler MouseHover; // overrides Control
   public event EventHandler MouseLeave; // overrides Control
   public event MouseEventHandler MouseMove; // overrides Control
   public event MouseEventHandler MouseUp; // overrides Control
   public event MouseEventHandler MouseWheel; // overrides Control
   public event PaintEventHandler Paint; // overrides Control
   public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp; // overrides Control
   public event QueryContinueDragEventHandler QueryContinueDrag; // overrides Control
   public event EventHandler RightToLeftChanged; // overrides Control
   public event EventHandler StyleChanged; // overrides Control
   public event EventHandler TabIndexChanged; // overrides Control
   public event EventHandler TabStopChanged; // overrides Control
   public event EventHandler TextChanged; // overrides Control
}

Hierarchy

System.Object System.MarshalByRefObject System.ComponentModel.Component(System.ComponentModel.IComponen, System.IDisposable) Control(IOleContro, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject, IOleWindow, IViewObject, IViewObject2, IPersist, IPersistStreamInit, IPersistPropertyBag, IPersistStorage, IQuickActivate, System.ComponentModel.ISynchronizeInvoke, IWin32Window) AxHost(System.ComponentModel.ISupportInitializ, System.ComponentModel.ICustomTypeDescriptor)

    [ Team LiB ] Previous Section Next Section