.

ConfigLoader.LoadFromFile

Load the configuration of a specified object to a file.

Version History

Introduced in MPX 2.0.

Result

Void

Arguments

 
Argument Type Description
obj Object The MPX object to be loaded.
filePath String

The file to read the configuration from.

Common Exceptions

 
Error Occurs when...
FileIO The file could not be read.
ConfigLoadException An error occurred while loading configuration and the user did not set the PropertyErrorEvent member.

Visual Basic

Syntax

Sub LoadFromFile(obj As Object, filePath As String)

Sample Code

 
Dim controller As Mpx.Controller = New Mpx.Controller(0)
Dim loader As Mpx.ConfigLoader = New Mpx.ConfigLoader()

' Have the OnLoadPropertyError method handle PropertyError events
AddHandler loader.PropertyErrorEvent AddressOf OnLoadPropertyError

loader.LoadFromFile(controller, "controllerConfig.xml")


Sample Application

 

C#

Syntax

void LoadFromFile(Object obj, string filePath);

Sample Code

 

Mpx.Controller controller = new Mpx.Controller(0);
Mpx.ConfigLoader loader = new Mpx.ConfigLoader();

// Have the OnLoadPropertyError method handle PropertyError events
loader.PropertyErrorEvent += OnLoadPropertyError;

loader.LoadFromFile(controller, "controllerConfig.xml");

See Also

ConfigLoader

 



       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2021 Motion Engineering