TypeExporter class
Dynamically exports .NET types to JS.
C#
public class TypeExporter
Public Members
name | description |
---|---|
TypeExporter(…) | Creates a new instance of the TypeExporter class. |
IsDelayLoadEnabled { get; set; } | Gets or sets a value indicating whether exporting of type members and their dependencies is delayed until first use. The default is true. |
ExportAssemblyTypes(…) | Exports all types from a .NET assembly to JavaScript. |
ExportGenericTypeDefinition(…) | |
ExportMethod(…) | Exports or re-exports an instance method on an already-exported type. This is used when adding extension methods to a type. |
ExportType(…) | Exports a specific .NET type to JS. |
Remarks
Exporting a .NET type: - Defines equivalent namespaced JS class prototype is defined, with a constructor function that calls back to the.NET constructor. - Defines static and instance properties and methods on the class prototype. Initially all of them are stubs (if IsDelayLoadEnabled
is true (the default), but on first access each property gets redefined to call back to the corresponding .NET property or method. The callback uses marshalling code dynamically generated by a JSMarshaller
. - Registers a mapping between the .NET type and JS class/constructor object with the JSRuntimeContext, for use in any marshalling operations.