HostFunctionsnewObj Method |
Creates an empty host object.
Namespace: Microsoft.ClearScriptAssembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.4.5
Syntax public PropertyBag newObj()
Public Function newObj As PropertyBag
public:
PropertyBag^ newObj()
member newObj : unit -> PropertyBag
Return Value
PropertyBagA new empty host object.
Remarks
This function is provided for script languages that do not support external
instantiation. It creates an object that supports dynamic property addition and
removal. The host can manipulate it via the
IPropertyBag interface.
Example
The following code creates an empty host object and adds several properties to it.
It assumes that an instance of
HostFunctions is exposed under
the name "host"
(see
AddHostObject).
var item = host.newObj();
item.label = "Widget";
item.weight = 123.45;
See Also