// Save the entire Controller configuration, including child objects.
//
// Handle ConfigSavePropertyStatus events in order to display
// progress and exclude Can and CanNode objects from being saved.
//
// Handle PropertyError events in order to display errors.
public void SaveController()
{
Mpx.Controller controller = new Mpx.Controller(0);
Mpx.ConfigSaver saver = new Mpx.ConfigSaver();
// Have the OnSavePropertyError method handle PropertyError events
saver.PropertyErrorEvent += OnSavePropertyError;
// Have the OnSavePropertyStatus method handle
// ConfigSavePropertyStatus events
saver.PropertyStatusEvent += OnSavePropertyStatus;
saver.SaveToFile(controller, "controllerConfig.xml");
}
|