WebBrowser.WebBrowserSite WebBrowser.WebBrowserSite WebBrowser.WebBrowserSite Class

定义

表示 WebBrowser 控件的宿主窗口。Represents the host window of a WebBrowser control.

protected: ref class WebBrowser::WebBrowserSite : System::Windows::Forms::WebBrowserSiteBase
[System.Runtime.InteropServices.ComVisible(false)]
protected class WebBrowser.WebBrowserSite : System.Windows.Forms.WebBrowserSiteBase
Protected Class WebBrowser.WebBrowserSite
Inherits WebBrowserSiteBase
继承
WebBrowser.WebBrowserSiteWebBrowser.WebBrowserSiteWebBrowser.WebBrowserSite
属性

注解

如果对使用非托管WebBrowser ActiveX 控件的 OLE 开发非常熟悉, 则可以扩展 Windows 窗体WebBrowser控件的功能, 这是 ActiveX 控件的托管包装。If you are familiar with OLE development using the unmanaged WebBrowser ActiveX control, you can extend the functionality of the Windows Forms WebBrowser control, which is a managed wrapper for the ActiveX control. 例如, 你可以使用此扩展性来自定义浏览器快捷菜单和快捷键, 或为托管文档提供自定义安全配置。You can use this extensibility, for example, to customize the browser shortcut menu and shortcut keys or to provide a custom security configuration for hosted documents.

若要使用此功能, 请实现从WebBrowserWebBrowser.WebBrowserSite类继承的类。To use this feature, implement classes that inherit from the WebBrowser and WebBrowser.WebBrowserSite classes. 非托管WebBrowser ActiveX 控件使用受保护WebBrowser.CreateWebBrowserSiteBase的方法来检索WebBrowser.WebBrowserSite类实现的扩展性接口。The unmanaged WebBrowser ActiveX control uses the protected WebBrowser.CreateWebBrowserSiteBase method to retrieve extensibility interfaces implemented by the WebBrowser.WebBrowserSite class. 重写WebBrowser.WebBrowserSite方法以返回你自己的从类继承的类的实例。 CreateWebBrowserSiteBaseOverride the CreateWebBrowserSiteBase method to return an instance of your own class that inherits from the WebBrowser.WebBrowserSite class. 类提供 OLE IDocHostUIHandler接口的默认实现。 WebBrowser.WebBrowserSiteThe WebBrowser.WebBrowserSite class provides a default implementations of the OLE IDocHostUIHandler interface. 有关详细信息, 请参阅 MSDN library 中的IDocHostUIHandler 接口For more information, see IDocHostUIHandler Interface in the MSDN library. 你可以提供自己的此接口的实现或实现任何其他WebBrowser ActiveX 控件接口, 以便自定义控件的行为。You can provide your own implementation of this interface or implement any other WebBrowser ActiveX control interface in order to customize the behavior of the control. 有关详细信息, 请参阅 MSDN library 中的WebBrowser 控件For more information, see WebBrowser Control in the MSDN library.

备注

如果为任何IDocHostUIHandler成员提供自己的实现, 则必须实现该接口的所有成员。If you provide your own implementation for any IDocHostUIHandler members, you must implement all the members of that interface.

构造函数

WebBrowser.WebBrowserSite(WebBrowser) WebBrowser.WebBrowserSite(WebBrowser) WebBrowser.WebBrowserSite(WebBrowser)

初始化 WebBrowser.WebBrowserSite 类的新实例。Initializes a new instance of the WebBrowser.WebBrowserSite class.

方法

Dispose() Dispose() Dispose()

释放由 WebBrowserSiteBase 使用的所有资源。Releases all resources used by the WebBrowserSiteBase.

(Inherited from WebBrowserSiteBase)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放由 WebBrowserSiteBase 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the WebBrowserSiteBase and optionally releases the managed resources.

(Inherited from WebBrowserSiteBase)
Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

安全性

SecurityPermission
用于重写此类型, 这需要访问非托管代码。for overriding this type, which requires access to unmanaged code. 关联的枚举InheritanceDemand : 和UnmanagedCodeAssociated enumerations: InheritanceDemand and UnmanagedCode

适用于

另请参阅