.

ConfigSaver.PropertyErrorEvent

This event is raised whenever an error occurs while saving configuration.

If this property is not set by the user, then the Save methods will throw a ConfigSaveException when an error occurs.

Otherwise, PropertyErrorEvent will be called whenever an error occurs.

It is recommended that you handle PropertyError events. If you do not, there will be an interruption of configuration saving if there is an internal MPX error, such as the failure to convert a property value to text.

It may be better to FAIL to save some configuration elements (and print a warning) than it is to halt saving configuration somewhere in the middle of the operation, resulting in an invalid configuration file.

Version History

Introduced in MPX 2.0.

Type

event ConfigSaver.PropertyErrorEventHandler

Default

Null

Visual Basic

Syntax

PropertyErrorEvent(ByVal sender As Mpx.ConfigSaver, ByVal args As Mpx.ConfigSavePropertyErrorEventArgs)

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

event PropertyErrorEventHandler PropertyErrorEvent

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, "controllerOnlyConfig.xml");

See Also

ConfigSaver

PropertyErrorEventHandler
ConfigSavePropertyErrorEventArgs

 

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