.

ConfigLoadPropertyErrorEventArgs.PropertyPath

Gets the period-delineated path to the property that caused the error. For example:

“Controller.Axis[3].Capture[1].SourceEnable[Home]”

Version History

Introduced in MPX 2.0.

Type

String (read only)

Visual Basic

Syntax

ReadOnly Property PropertyPath() As String

Sample Code

 

' This method handles PropertyError events that occur while

' loading the configuration of an object.

Public Sub OnLoadPropertyError(ByVal loader As Mpx.ConfigLoader,

ByVal e As Mpx.ConfigLoadPropertyErrorEventArgs)

   Dim msg As String = "Warning: "

 

   Select Case e.ErrorCode

      Case Mpx.ConfigLoadErrorCode.Missing

      Case Else

         Dim msg As String = "Warning: "

            msg += e.PropertyPath

            msg += ": "

            msg += e.Message

         System.Console.WriteLine(msg)

   End Select

 

End Sub

 


Sample Application

 

C#

Syntax

string PropertyPath { get; }

Sample Code

 

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

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

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

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

See Also

ConfigLoadPropertyErrorEventArgs

 

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