Clr Object

Provides experimental access to .NET assemblies through ordinary script property, method, call and index syntax.

This class is exported by the KS module.

Experimental: Basic values and function objects are marshalled, but complex .NET types might not convert correctly.

Load

Root := Clr.Load(AssemblyOrPath)

Loads a DLL/executable path or assembly name and returns a ManagedAssembly or ManagedNamespace wrapper.

Name Helpers

Name := Clr.GetNamespaceName(ManagedNamespace)
Name := Clr.GetTypeName(ManagedType)

Returns the underlying full namespace or type name.

Examples

#Import "Ks" { Clr }
System := Clr.Load("System")
Linq := System.Linq.Enumerable
Odds := Linq.Where([1, 2, 3, 4], n => Mod(n, 2))