Skip to content

API Host ScriptMethodDelegate

Liu.Yandong.Hanks edited this page Aug 21, 2026 · 3 revisions

ScriptMethodDelegate

Delegate shape for host-held callable script methods.

Namespace: AuroraScript.Runtime. Kind: delegate.

Back to .NET Host API Reference

Overview

Delegate shape for host-held callable script methods.

Quick Reference

A minimal use of ScriptMethodDelegate.

ScriptMethodDelegate echo = (userState, arguments) =>
    arguments.Length == 0 ? ScriptDatum.Null : arguments[0];

var echoed = echo(null, ScriptDatum.FromNumber(42));
Console.WriteLine(echoed.Number); // 42

Methods

Invoke

ScriptDatum Invoke(ScriptObject userState = null, params ScriptDatum[] arguments)

Parameters

Name Type Required Description
userState ScriptObject No User state associated with the execution context.
arguments ScriptDatum[] No Argument array passed to a script or callback.

Returns

Returns ScriptDatum.

Clone this wiki locally