ConfigSavePropertyStatusEventArgs Class


  ConfigSavePropertyStatusEventArgs
 PropertyPath
 PercentageDone
 SkipProperty

Visual Basic

Syntax

Class ConfigSavePropertyStatusEventArgs

Sample Code

 
' This method handles PropertyStatus events that occur while 
' saving the configuration of an object.
Public Sub OnSavePropertyStatus(ByVal saver As Mpx.ConfigSaver, 
ByVal e As Mpx.ConfigSavePropertyStatusEventArgs)
    Dim msg As String

    ' Print the current property and the percentage done
    ' Example output:
    ' 25%: Controller.Axis[2].MotorType
    '     skipped
    msg = e.PercentageDone.ToString()
    msg += "%: "
    msg += e.PropertyPath
    System.Console.WriteLine(msg)

    ' Don't save CAN or CAN Node objects
    If e.PropertyPath.StartsWith("Controller.Can") Then
        System.Console.WriteLine("    skipped")
        e.SkipProperty = True
    End If

End Sub


Sample Application

 

C#

Syntax

class ConfigSavePropertyStatusEventArgs

Sample Code

 

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

public void OnSavePropertyStatus(Mpx.ConfigSaver saver,
   Mpx.ConfigSavePropertyStatusEventArgs e)
{
   string msg;

   // Print the current property and the percentage done
   // Example output:
   // 25%: Controller.Axis[2].AmpDisableAction
   // skipped

   msg = e.PercentageDone
      + "%: "
      + e.PropertyPath
      + "\n";
   System.Console.Write(msg);

   // Don't save CAN or CAN Node objects
   if (e.PropertyPath.StartsWith("Controller.Can"))
   {
      System.Console.Write(" skipped\n");
      e.SkipProperty = true;
   }
}

See Also

Serialization Overview | ConfigSaver