ConfigLoader Object




 

  ConfigLoader
 LoadFromFile
 Cancel
 PropertyErrorEventHandler
 PropertyStatusEvent
 PropertyStatusEventHandler
 

Visual Basic

Syntax

Class ConfigLoader 

Sample Code

 
' Load controller configuration.
' Handle PropertyError events in order to display errors and warnings.
' Handle PropertyStatus events in order to display progress.
Public Sub LoadController()
   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

   ' Have the OnLoadPropertyStatus method handle PropertyStatus events
   AddHandler loader.PropertyStatusEvent AddressOf OnLoadPropertyStatus

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


Sample Application

 

C#

Syntax

class ConfigLoader

Sample Code

 

// Load controller configuration.
// Handle PropertyError events in order to display errors and warnings.
// Handle PropertyStatus events in order to display progress.

public void LoadController()
{
   Mpx.Controller controller = new Mpx.Controller(0);
   Mpx.ConfigLoader loader = new Mpx.ConfigLoader();

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

   // Have the OnLoadPropertyStatus method handle PropertyStatus
   // events.

   loader.PropertyStatusEvent += OnLoadPropertyStatus;

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

See Also

Serialization Overview

Enumerations
ConfigLoadErrorCode
ConfigLoadPropertyErrorEventArgs
ConfigLoadPropertyStatusEventArgs