共用方式為


HtmlObject Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Provides methods for browser elements that are explicitly supplied by the HTML features exposed by Silverlight.

Inheritance Hierarchy

System.Object
  System.Windows.Browser.ScriptObject
    System.Windows.Browser.HtmlObject
      System.Windows.Browser.HtmlDocument
      System.Windows.Browser.HtmlElement
      System.Windows.Browser.HtmlWindow

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

Syntax

'Declaration
Public MustInherit Class HtmlObject _
    Inherits ScriptObject
public abstract class HtmlObject : ScriptObject

The HtmlObject type exposes the following members.

Constructors

  Name Description
Protected method HtmlObject Initializes a new instance of the HtmlObject class.

Top

Properties

  Name Description
Public property Dispatcher Gets an instance of the dispatcher. (Inherited from ScriptObject.)
Public property ManagedObject Gets the underlying managed object reference of the ScriptObject. (Inherited from ScriptObject.)

Top

Methods

  Name Description
Public method AttachEvent(String, EventHandler) Attaches the specified .NET Framework event handler (EventHandler) to the specified event on the current Document Object Model (DOM) object.
Public method AttachEvent(String, EventHandler<HtmlEventArgs>) Attaches the specified .NET Framework event handler (EventHandler<TEventArgs>) to the specified event on the current Document Object Model (DOM) object.
Public method CheckAccess Determines whether the current thread is the browser's UI thread. (Inherited from ScriptObject.)
Protected method ConvertTo(Type, Boolean) Converts the current object to a specified type. This method is not supported. (Overrides ScriptObject.ConvertTo(Type, Boolean).)
Public method ConvertTo<T>() Converts the current scriptable object to a specified type. (Inherited from ScriptObject.)
Public method DetachEvent(String, EventHandler) Detaches the specified.NET Framework event handler (EventHandler) from the specified event on the current Document Object Model (DOM) object.
Public method DetachEvent(String, EventHandler<HtmlEventArgs>) Detaches the specified .NET Framework event handler (EventHandler<TEventArgs>) from the specified event on the current Document Object Model (DOM) object.
Public method Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected method Finalize Frees resources and performs other cleanup operations before the scriptable object is reclaimed by garbage collection. (Inherited from ScriptObject.)
Public method GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public method GetProperty(Int32) Gets the value of a property that is identified by ordinal number on the current scriptable object. (Inherited from ScriptObject.)
Public method GetProperty(String) Gets the value of a property that is identified by name on the current scriptable object. (Inherited from ScriptObject.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method Initialize Infrastructure. Initializes a scriptable object. (Inherited from ScriptObject.)
Public method Invoke Invokes a method on the current scriptable object, and optionally passes in one or more method parameters. (Inherited from ScriptObject.)
Public method InvokeSelf Invokes the current ScriptObject and assumes that it represents a JavaScript method. (Inherited from ScriptObject.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method SetProperty(Int32, Object) Sets the value of a property that is identified by ordinal number on the current scriptable object. (Inherited from ScriptObject.)
Public method SetProperty(String, Object) Sets a property that is identified by name on the current scriptable object. (Inherited from ScriptObject.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Explicit Interface Implementations

  Name Description
Explicit interface implemetationPrivate method IDynamicMetaObjectProvider.GetMetaObject Returns the DynamicMetaObject responsible for binding operations performed on this object. (Inherited from ScriptObject.)

Top

Remarks

The HTML Document Object Model (DOM) features exposed by Silverlight are called the HTML Bridge. For more information, see HTML Bridge: Interaction Between HTML and Managed Code.

Because DOM objects are inherently scriptable, an HtmlObject is also a scriptable object.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.