ConfigLoadPropertyStatusEventArgs Class

  ConfigLoadPropertyStatusEventArgs
 PropertyPath
 PercentageDone
 CurrentValueText
 NewValueText
 SkipProperty

Visual Basic

Syntax

Class ConfigLoadPropertyStatusEventArgs

Sample Code

 
' This method handles PropertyStatus events that occur while 
' loading configuration to an object.
Public Sub OnLoadPropertyStatus(ByVal loader As Mpx.ConfigLoader, 
ByVal e As Mpx.ConfigLoadPropertyStatusEventArgs)
    Dim msg As String

    ' Print the current property and the percentage done
    ' Example output:
    ' 25%: Controller.Axis[2].MotorType
    '     Current Value: Servo
    '     New Value: Stepper
    msg = e.PercentageDone.ToString()
    msg += "%: "
    msg += e.PropertyPath

    If e.NewValueText <> e.CurrentValueText Then
        ' The property value is going to change. Display the 
        ' current value and the new value.
        msg += System.Environment.NewLine
        msg += "    Current Value: " + e.CurrentValueText
        msg += System.Environment.NewLine
        msg += "    New Value: " + e.NewValueText
    End If

    System.Console.WriteLine(msg)
End Sub


Sample Application

 

C#

Syntax

class ConfigLoadPropertyStatusEventArgs

Sample Code

 

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

public void OnLoadPropertyStatus(Mpx.ConfigLoader loader,
   Mpx.ConfigLoadPropertyStatusEventArgs e)
{
   string msg;

   // Print the current property and the percentage done
   // Example output:
   // 25%: Controller.Axis[2].AmpDisableAction
   //    Current Value: None
   //    New Value: CmdEqAct

   msg = e.PercentageDone
      + "%: "
      + e.PropertyPath
      + "\n";

   if (e.NewValueText != e.CurrentValueText)
   {
      // The property value is going to change. Display the current value
      // and the new value.
      msg += " Current Value: "
         + e.CurrentValueText
         + "\n New Value: "
         + e.NewValueText
         + "\n";
   }

   System.Console.Write(msg);
}

See Also

Serialization Overview

ConfigLoader