using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.CodeDom;
using System.Xml.Linq;

namespace DynamicCompiler
{
    public partial class FunctionScript
    {
        /// <summary>
        /// 返回参数列表
        /// </summary>
        /// <returns></returns>
        public List<CodeParameterDeclarationExpression> GetParameterList()
        {
            List<CodeParameterDeclarationExpression> parameterList = new List<CodeParameterDeclarationExpression>();
            if (this.Parameters!=null)
            {
                var x = from n in this.Parameters.Elements("Parameter")
                        select n;
                foreach (var item in x)
                {
                    parameterList.Add(new CodeParameterDeclarationExpression(
                        Type.GetType((string)item.Element("Type")),
                        (string)item.Element("ParameterName")));

                }
                
            }
           
            return parameterList;
        }
    }
}
