EvaluateExpressionsResult EvaluateExpressions(OdId tObject, EvaluateExpressionsArg tArg)
tObject. Moniker of the development environment object, for which debugging is running.
tArg. Operation execution parameters.
The EvaluateExpressions operation calculates expressions during code debugging.
The operation calculates one or several expressions in the debugging mode, which result in simple type values. To execute the operation, in the tObject field specify moniker of the object that is in debugging mode, and in the tArg field specify expression calculation parameters.
The operation results in the obtained values and the collection of linked properties.
Below is the example of calculating values for two expressions during code debugging. The request contains moniker of the object that is in debugging mode and a list of calculated expressions. The response contains the obtained expression values.
{
"EvaluateExpressions" :
{
"tObject" :
{
"id" : "PBIOBPCAEDCOFOAEFFEFLOBMFDKGKIMENIGAAFCLHCNIIEAC!M!305559"
},
"tArg" :
{
"expressions" :
{
"it" :
[
"count",
"value"
]
},
"withProperties" : "true"
}
}
}
{
"EvaluateExpressionsResult" :
{
"evaluatedExpressions" :
{
"it" :
[
{
"name" : "count",
"className" : "System.Integer",
"value" : "5",
"properties" :
{
"it" : "ToString"
}
},
{
"name" : "value",
"className" : "System.Double",
"value" : "100.5",
"properties" :
{
"it" : "ToString"
}
}
]
}
}
}
public static EvaluateExpressionsResult EvaluateExpressions(MbId mb, string modId, string[] evaluateExpressions)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tGet = new EvaluateExpressions()
{
tArg = new EvaluateExpressionsArg()
{
expressions = evaluateExpressions,
withProperties = true
},
// Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, modId).k }
};
// Calculate expression
var result = somClient.EvaluateExpressions(tGet);
return result;
}
See also: