.

ConfigLoadPropertyStatusEventArgs.CurrentValueText

This is a string that represents the current value of the property.

Version History

Introduced in MPX 2.0.

Type

String (read only)

Visual Basic

Syntax

ReadOnly Property CurrentValueText() As String

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

string CurrentValueText { get; }

Sample Code

 

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

public void OnLoadPropertyStatus(Mpx.ConfigLoader loader,
    Mpx.ConfigLoadPropertyStatusEventArgs e)
{
    if (e.NewValueText != e.CurrentValueText)
    {
        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";

        // 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

ConfigLoadPropertyStatusEventArgs

 

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