ClearScript Library
ClearScript Library
ClearScript Library Reference
Microsoft.ClearScript
ScriptObject Class
ScriptObject Properties
ScriptObject Methods

# ScriptObject Class

Provides the base implementation for all script objects.
Inheritance Hierarchy
SystemObject
System.DynamicDynamicObject
Microsoft.ClearScriptScriptObject
Namespace: Microsoft.ClearScript
Assembly: ClearScript.Core (in ClearScript.Core.dll) Version: 7.5.0
Syntax
C#
VB
C++
F#
Copy

    public abstract class ScriptObject : DynamicObject,
    	IScriptObject, IDisposable

    Public MustInherit Class ScriptObject
    	Inherits DynamicObject
    	Implements IScriptObject, IDisposable

    public ref class ScriptObject abstract : public DynamicObject,
    	IScriptObject, IDisposable

    [<AbstractClassAttribute>]
    type ScriptObject =
        class
            inherit DynamicObject
            interface IScriptObject
            interface IDisposable
        end

The ScriptObject type exposes the following members.

Properties

| Name | Description
--- | --- | ---
| Engine | Gets the script engine that owns the object.
| ItemInt32 | Gets or sets the value of an indexed script object property.
| ItemString, Object | Gets or sets the value of a named script object property.
| PropertyIndices | Enumerates the script object's property indices.
| PropertyNames | Enumerates the script object's property names.

Top
Methods

| Name | Description
--- | --- | ---
| DeleteProperty(Int32) | Removes an indexed script object property.
| DeleteProperty(String) | Removes a named script object property.
| Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
| 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)
| GetDynamicMemberNames | Returns the enumeration of all dynamic member names. (Inherited from DynamicObject)
| GetHashCode | Serves as the default hash function. (Inherited from Object)
| GetMetaObject | Provides a DynamicMetaObject that dispatches to the dynamic virtual methods. The object can be encapsulated inside another DynamicMetaObject to provide custom behavior for individual actions. This method supports the Dynamic Language Runtime infrastructure for language implementers and it is not intended to be used directly from your code. (Inherited from DynamicObject)
| GetProperty(Int32) | Gets the value of an indexed script object property.
| GetProperty(String, Object) | Gets the value of a named script object property.
| GetType | Gets the Type of the current instance. (Inherited from Object)
| Invoke | Invokes the script object.
| InvokeAsFunction | Invokes the script object as a function.
| InvokeMethod | Invokes a script object method.
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object)
| SetProperty(Int32, Object) | Sets the value of an indexed script object property.
| SetProperty(String, Object) | Sets the value of a named script object property.
| ToString | Returns a string that represents the current object. (Inherited from Object)
| TryBinaryOperation | Provides implementation for binary operations. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as addition and multiplication. (Inherited from DynamicObject)
| TryConvert | Provides implementation for type conversion operations. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations that convert an object from one type to another. (Inherited from DynamicObject)
| TryCreateInstance | Provides the implementation for operations that initialize a new instance of a dynamic object. This method is not intended for use in C# or Visual Basic. (Inherited from DynamicObject)
| TryDeleteIndex | Provides the implementation for operations that delete an object by index. This method is not intended for use in C# or Visual Basic. (Inherited from DynamicObject)
| TryDeleteMember | Provides the implementation for operations that delete an object member. This method is not intended for use in C# or Visual Basic. (Inherited from DynamicObject)
| TryGetIndex | Provides the implementation for operations that get a value by index. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for indexing operations. (Inherited from DynamicObject)
| TryGetMember | Provides the implementation for operations that get member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as getting a value for a property. (Inherited from DynamicObject)
| TryInvoke | Provides the implementation for operations that invoke an object. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. (Inherited from DynamicObject)
| TryInvokeMember | Provides the implementation for operations that invoke a member. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as calling a method. (Inherited from DynamicObject)
| TrySetIndex | Provides the implementation for operations that set a value by index. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations that access objects by a specified index. (Inherited from DynamicObject)
| TrySetMember | Provides the implementation for operations that set member values. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as setting a value for a property. (Inherited from DynamicObject)
| TryUnaryOperation | Provides implementation for unary operations. Classes derived from the DynamicObject class can override this method to specify dynamic behavior for operations such as negation, increment, or decrement. (Inherited from DynamicObject)

Top
See Also

#### Reference

Microsoft.ClearScript Namespace

Copyright © Microsoft Corporation. All rights reserved.

Send comments on this topic to Microsoft