DataDictionary.Interpreter.Call.SelectXandYAxis C# (CSharp) Method

SelectXandYAxis() private method

Selects the X and Y axis of the surface to be created according to the function for which the surface need be created and the parameters on which the surface is created
private SelectXandYAxis ( Utils.Parameter xParam, Utils.Parameter yParam, Function function, Utils.Parameter &xAxis, Utils.Parameter &yAxis ) : void
xParam Utils.Parameter The X parameter for which the surface need be created
yParam Utils.Parameter The Y parameter for which the surface need be created
function Function The function creating the surface
xAxis Utils.Parameter The resulting X axis
yAxis Utils.Parameter The resulting Y axis
return void
        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;
                        }
                    }
                }
            }
        }