private void SelectXandYAxis(Parameter xParam, Parameter yParam,
Function function, out Parameter xAxis, out Parameter yAxis)
{
xAxis = null;
yAxis = null;
Dictionary<Parameter, Expression> association = GetParameterAssociation(function);
if (association != null)
{
foreach (KeyValuePair<Parameter, Expression> pair in association)
{
if (pair.Value.Ref == xParam)
{
if (xAxis == null)
{
xAxis = pair.Key;
}
else
{
Root.AddError("Cannot evaluate surface for function call " + ToString() +
" which has more than 1 X axis parameter");
xAxis = null;
break;
}
}
if (pair.Value.Ref == yParam)
{
if (yAxis == null)
{
yAxis = pair.Key;
}
else
{
Root.AddError("Cannot evaluate surface for function call " + ToString() +
" which has more than 1 Y axis parameter");
yAxis = null;
break;
}
}
}
}
}