ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
HostTypeCollection Class
HostTypeCollection Constructor
HostTypeCollection Properties
HostTypeCollection Methods
HostTypeCollection Events

# HostTypeCollection Class

Represents a scriptable collection of host types.
Inheritance Hierarchy
SystemObject
Microsoft.ClearScriptPropertyBag
Microsoft.ClearScriptHostTypeCollection
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public class HostTypeCollection : PropertyBag

    Public Class HostTypeCollection
    	Inherits PropertyBag

    public ref class HostTypeCollection : public PropertyBag

    type HostTypeCollection =
        class
            inherit PropertyBag
        end

The HostTypeCollection type exposes the following members.

Constructors

| Name | Description
--- | --- | ---
| HostTypeCollection | Initializes a new host type collection.
| HostTypeCollection(Assembly) | Initializes a new host type collection with types from one or more assemblies.
| HostTypeCollection(String) | Initializes a new host type collection with types from one or more assemblies. The assemblies are specified by name.
| HostTypeCollection(PredicateType, Assembly) | Initializes a new host type collection with selected types from one or more assemblies.
| HostTypeCollection(PredicateType, String) | Initializes a new host type collection with selected types from one or more assemblies. The assemblies are specified by name.

Top
Properties

| Name | Description
--- | --- | ---
| Comparer | Gets the property name comparer for the PropertyBag. (Inherited from PropertyBag)
| Item | Gets or sets a property value in the PropertyBag. (Inherited from PropertyBag)
| Keys | Gets a collection of property names from the PropertyBag. (Inherited from PropertyBag)
| Values | Gets a collection of property values from the PropertyBag. (Inherited from PropertyBag)

Top
Methods

| Name | Description
--- | --- | ---
| Add | Adds a property to the PropertyBag. (Inherited from PropertyBag)
| AddAssembly(Assembly) | Adds types from an assembly to a host type collection.
| AddAssembly(String) | Adds types from an assembly to a host type collection. The assembly is specified by name.
| AddAssembly(Assembly, PredicateType) | Adds selected types from an assembly to a host type collection.
| AddAssembly(String, PredicateType) | Adds selected types from an assembly to a host type collection. The assembly is specified by name.
| AddType(Type) | Adds a type to a host type collection.
| AddType(String, Type) | Adds a type to a host type collection. The type is specified by name.
| AddType(String, String, Type) | Adds a type to a host type collection. The type is specified by type name and assembly name.
| ClearNoCheck | Removes all properties without checking whether the PropertyBag is read-only. (Inherited from PropertyBag)
| ContainsKey | Determines whether the PropertyBag contains a property with the specified name. (Inherited from PropertyBag)
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object)
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object)
| GetHashCode | Serves as the default hash function. (Inherited from Object)
| GetNamespaceNode | Locates a namespace within a host type collection.
| GetType | Gets the Type of the current instance. (Inherited from Object)
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object)
| Remove | Removes a property from the PropertyBag. (Inherited from PropertyBag)
| RemovePropertyNoCheck | Removes a property without checking whether the PropertyBag is read-only. (Inherited from PropertyBag)
| SetPropertyNoCheck | Sets a property value without checking whether the PropertyBag is read-only. (Inherited from PropertyBag)
| ToString | Returns a string that represents the current object. (Inherited from Object)
| TryGetValue | Looks up a property value in the PropertyBag. (Inherited from PropertyBag)

Top
Events

| Name | Description
--- | --- | ---
| PropertyChanged | Occurs when a property is added or replaced, or when the collection is cleared. (Inherited from PropertyBag)

Top
Remarks
Host type collections provide convenient scriptable access to all the types defined in one or more host assemblies. They are hierarchical collections where leaf nodes represent types and parent nodes represent namespaces. For example, if an assembly contains a type named "Acme.Gadgets.Button", the corresponding collection will have a property named "Acme" whose value is an object with a property named "Gadgets" whose value is an object with a property named "Button" whose value represents the Acme.Gadgets.Button host type. Use AddHostObject to expose a host type collection to script code.
See Also

#### Reference

Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft