.

ConfigSaver.Cancel

Calling this method will cancel the save operation.

Version History

Introduced in MPX 2.0.

Result

Void

Visual Basic

Syntax

Sub Cancel()

Sample Code

 
' This method handles PropertyError events that occur while 
' saving the configuration of an object.
Public Sub OnSavePropertyError(ByVal saver As Mpx.ConfigSaver, 
ByVal e As Mpx.ConfigSavePropertyErrorEventArgs)
    ' Example output:
    ' Error: Controller.Axis[2]: Axis is not enabled
    Dim msg As String = "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!")
    End If
End Sub


Sample Application

 

C#

Syntax

void Cancel ()

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");
   }
}

See Also

ConfigSaver

 

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