DataDictionary.Interpreter.BinaryExpression.CreateSurfaceResult C# (CSharp) Method

CreateSurfaceResult() private method

Creates the result as a surface
private CreateSurfaceResult ( DataDictionary.Interpreter.InterpretationContext context, DataDictionary.Functions.Function leftFunction, List unboundLeft, DataDictionary.Functions.Function rightFunction, List unboundRight, ExplanationPart explain ) : ICallable
context DataDictionary.Interpreter.InterpretationContext
leftFunction DataDictionary.Functions.Function
unboundLeft List
rightFunction DataDictionary.Functions.Function
unboundRight List
explain ExplanationPart
return ICallable
        private ICallable CreateSurfaceResult(InterpretationContext context, Function leftFunction,
            List<Parameter> unboundLeft, Function rightFunction, List<Parameter> unboundRight, ExplanationPart explain)
        {
            ICallable retVal = null;

            Surface leftSurface = CreateSurfaceForUnbound(context, Left, leftFunction, unboundLeft, explain);
            if (leftSurface != null)
            {
                Surface rightSurface = CreateSurfaceForUnbound(context, Right, rightFunction, unboundRight, explain);
                if (rightSurface != null)
                {
                    retVal = CombineSurface(leftSurface, rightSurface).Function;
                }
                else
                {
                    AddError("Cannot create surface for " + Right, RuleChecksEnum.ExecutionFailed);
                }
            }
            else
            {
                AddError("Cannot create surface for " + Left, RuleChecksEnum.ExecutionFailed);
            }

            return retVal;
        }