/// Converts enum from .Net object.
public server static int convertEnumFromDotNet(System.Object _dotNetEnumValue)
{
int ret = CLRInterop::getAnyTypeForObject(_dotNetEnumValue);
return ret;
}
/// Converts enum to .Net object.
public server static CLRObject convertEnumToDotNet(EnumName _enumName, anytype _enumValue)
{
CLRObject ret = Microsoft.Dynamics365.Tax.Core.TaxEngineService::intToEnum(
_enumName,
enum2int(_enumValue));
return ret;
}
/// Converts field from .Net object.
public server static anytype convertFieldValueFromDotNet(System.Object _dotNetValue)
{
anytype ret;
if (_dotNetValue)
{
ERIEnumValue dotNetEREnumValue = _dotNetValue as ERIEnumValue;
if (dotNetEREnumValue != null)
{
ret = new EREnumValueBase(
dotNetEREnumValue.getEnumName(),
dotNetEREnumValue.getTypeNamePrefix(),
dotNetEREnumValue.getName(),
dotNetEREnumValue.getLabel());
}
else
{
ret = CLRInterop::getAnyTypeForObject(_dotNetValue);
}
}
return ret;
}
No comments:
Post a Comment