JetoReader

Since v2.14
public static class JetoReader
Methods to load Eto objects from .jeto (JSON) files
Remarks: Set EtoXamlJeto to true in your project to embed .jeto files, and EtoXamlCodeGen to compile them. Use XamlReader for .xeto files.

Methods

Load<T>

#
public static T Load<T>()
Loads the specified type from the embedded .jeto of the same name, e.g. MyNamespace.MyType.jeto
A new instance of the specified type with the contents loaded from the jeto

Load<T>

#
public static T Load<T>(Stream stream, T instance, XamlReaderSettings settings)
Loads the specified type from the specified jeto stream
stream (Stream)Jeto content to load (e.g. from resources)
instance (T)Instance to use as the starting object, or null to create a new instance
settings (XamlReaderSettings)Settings for reading the jeto
A new or existing instance of the specified type with the contents loaded from the jeto stream

Load<T>

#
public static T Load<T>(Stream stream, T instance)
Loads the specified type from the specified jeto stream
stream (Stream)Jeto content to load (e.g. from resources)
instance (T)Instance to use as the starting object, or null to create a new instance
A new or existing instance of the specified type with the contents loaded from the jeto stream

Load<T>

#
public static T Load<T>(Stream stream)
Loads the specified type from the specified jeto stream
stream (Stream)Jeto content to load (e.g. from resources)
A new instance of the specified type with the contents loaded from the jeto stream

Load<T>

#
public static T Load<T>(TextReader reader, T instance)
Loads the specified type from the specified jeto reader.
reader (TextReader)Reader to read the jeto content
instance (T)Instance to use as the starting object, or null to create a new instance
A new or existing instance of the specified type with the contents loaded from the jeto

Load<T>

#
public static void Load<T>(T instance, string resourceName)
Loads the specified instance from a fully qualified .jeto embedded resource in the same assembly as T
instance (T)Instance to use as the starting object
resourceName (string)Fully qualified name of the embedded resource to load.

Load<T>

#
public static void Load<T>(T instance, XamlReaderSettings settings)
Loads the specified instance from the embedded .jeto of the same name, e.g. MyNamespace.MyType.jeto
instance (T)Instance to use as the starting object
settings (XamlReaderSettings)Settings for reading the jeto, or null to use compiled code when available

Load<T>

#
public static void Load<T>(T instance)
Loads the specified instance from the embedded .jeto of the same name, e.g. MyNamespace.MyType.jeto, or runs its compiled code when EtoXamlCodeGen is enabled.

Watch<T>

#
public static bool Watch<T>(T control, string fileName = null, string sourcePath = null)
Watches the .jeto file for changes and triggers the method specified by the HotReloadAttribute, if any, when the file changes. Otherwise, it will reload the jeto into the control using Load<T>(T).
control (T)Instance of the control to watch for changes
fileName (string = null)Name of the file to watch, or null to use the default based on the class name
sourcePath (string = null)Source path of the file to watch
true if the file is being watched, false otherwise