A ConfigSavePropertyError event is raised when an error occurs while saving object configuration.
The ConfigSavePropertyErrorEventArgs class provides information such as the error type and the string representation of the property that generated the error.
' This method handles PropertyError events that occur while ' saving the configuration of an object.PublicSub OnSavePropertyError(ByVal saver As Mpx.ConfigSaver,
ByVal e As Mpx.ConfigSavePropertyErrorEventArgs)
' Example output:' Error: Controller.Axis[2]: Axis is not enabledDim msg AsString = "Error: "
msg += e.PropertyPath
msg += ": "
msg += e.Message
System.Console.WriteLine(msg)
If e.ErrorCode = Mpx.ConfigSaveErrorCode.Internal Then' Cancel the save operation
saver.Cancel()
System.Console.WriteLine("Canceled!")
EndIfEndSub
Sample Application
C#
Syntax
class ConfigSavePropertyErrorEventArgs
Sample Code
// This method handles PropertyError events that occur while saving
// the configuration of an object. public void OnSavePropertyError(Mpx.ConfigSaver saver,
Mpx.ConfigSavePropertyErrorEventArgs e)
{ // Example output:
// ERROR: Controller.Axis[2]: Axis is not enabled string msg = "ERROR: "
+ e.PropertyPath
+ ": "
+ e.Message
+ "\n";
System.Console.Write(msg);
if (e.ErrorCode == Mpx.ConfigSaveErrorCode.Internal)
{ // Cancel the save operation
saver.Cancel();
System.Console.Write("Canceled!\n");
}
}