ConfigSaver.SaveToFile
Save 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 saved. |
filePath |
String |
The file to write the configuration to. |
|
Common Exceptions
|
Error |
Occurs when... |
FileIO |
The file could not be written to. |
ConfigSaveException |
An error occurred while saving configuration and the user did not set the PropertyErrorEvent member. |
|
Visual Basic
Syntax
Sub SaveToFile(ByVal obj As Mpx.IObjectBase, ByVal filePath As String)
Sample Code
|
Dim controller As Mpx.Controller = New Mpx.Controller(0)
Dim saver As Mpx.ConfigSaver = New Mpx.ConfigSaver()
' Have the OnSavePropertyError method handle
' PropertyError(events)
AddHandler saver.PropertyErrorEvent, _
AddressOf OnSavePropertyError
saver.SaveToFile(controller, "controllerConfig.xml")
|
Sample Application
C#
Syntax
void SaveToFile(Object obj, string filePath);
Sample Code
|
Mpx.Controller controller = new Mpx.Controller(0); Mpx.ConfigSaver saver = new Mpx.ConfigSaver();
// Have the OnSavePropertyError method handle PropertyError events
saver.PropertyErrorEvent += OnSavePropertyError;
saver.SaveToFile(controller, "controllerConfig.xml");
|
See Also
ConfigSaver
|