Exemplo n.º 1
0
        /// <summary>
        /// generates an output for a function 
        /// </summary>
        /// <param name="myFunc">the function</param>
        /// <param name="myFuncName">function name</param>
        /// <param name="myTypeManager">type manager</param>
        /// <returns>a list of readouts which contains the information</returns>
        private Vertex GenerateOutput(ABaseFunction myFunc, String myFuncName, DBTypeManager myTypeManager)
        {
            var Func = new Dictionary<String, Object>();

            Func.Add("Name",        myFuncName);
            Func.Add("Description", myFunc.GetDescribeOutput());

            #region Add function parameters

            var parameters = new Dictionary<String, Object>();
            foreach (var param in myFunc.GetParameters())
            {
                if (param.VariableNumOfParams)
                {
                    GraphDBType[] myArray = { myTypeManager.GetTypeByName(param.DBType.ObjectName) };
                    parameters.Add(param.Name, myArray);
                }
                else
                {
                    parameters.Add(param.Name, myTypeManager.GetTypeByName(param.DBType.ObjectName));
                }
            }

            Func.Add("Parameters", new Edge(null, new Vertex(parameters)));

            #endregion

            return new Vertex(Func);
        }
 public Error_FunctionParameterCountMismatch(ABaseFunction myFunction, Int32 myExpectedParameterCount, Int32 myCurrentParameterCount)
 {
     ExpectedParameterCount = myExpectedParameterCount;
     CurrentParameterCount = myCurrentParameterCount;
     Function = myFunction;
 }