toExternal

Summary

Constructs a new external object with each key-value pair of the internal Dictionary<T> converted to external (via toExternal calls on each value of the key-value pairs). If an element does not implement the System.IExportable interface, a `System.

Usage

public override external toExternal()

Returns

A new external object with each element converted to external.

Description

Constructs a new external object with each key-value pair of the internal Dictionary<T> converted to external (via toExternal calls on each value of the key-value pairs).

If an element does not implement the System.IExportable interface, a System.Exceptions.ConversionException will be thrown.

Examples

Basic Usage
1
2
3
4
5
6
7
8
9
10
11
12
13
import System;
 
class Foo<T> : IExportable
{
    public override function toExternal() {
        return "foo";
    }
}
 
auto dict = new Dictionary<Foo<string>>();
dict["bar"] = new Foo<string>();
 
Console.log(dict.toExternal()); // {"bar":"foo"}

Share

HTML | BBCode | Direct Link