.

ConfigLoader.Cancel

Calling this method will cancel the load 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 loading 
' configuration to an object.
Sub OnLoadPropertyError(loader As Mpx.ConfigLoader, _
    e As Mpx.ConfigLoadPropertyErrorEventArgs)

   If e.ErrorCode <> Mpx.ConfigLoadErrorCode.Missing Then

       ' Print an error message
       Dim msg As String = "Error: " + e.PropertyPath + _
           ": " + e.Message
       System.Console.WriteLine(msg)

       ' Cancel the load operation
       loader.Cancel()

   End If
End Sub


Sample Application

 

C#

Syntax

void Cancel ()

Sample Code

 

// This method handles PropertyError events that occur while loading
// configuration to an object.

void OnLoadPropertyError(Mpx.ConfigLoader loader,
   Mpx.ConfigLoadPropertyErrorEventArgs e)
{

   if (e.ErrorCode != Mpx.ConfigLoadErrorCode.Missing)
   {
       // Cancel the load operation
       loader.Cancel();

       // Print an error message
       string msg = "Error: ";
       msg += e.PropertyPath
           + ": "
           + e.Message
           + "\n";
       System.Console.Write(msg);
   }
}


See Also

ConfigLoader

 

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