public MethodTemplate(MethodInfo method)
        {
            Method     = method;
            Name       = method.Name;
            IsAsync    = method.ReturnType.FullName.StartsWith(typeof(Task).FullName);
            ReturnType = new TypeTemplate(method.ReturnType);
            foreach (var attr in CustomAttributeData.GetCustomAttributes(method))
            {
                AttributeList.Add(new CustomAttributeTemplate(attr).ToString());
            }
            //方法参数
            foreach (var parameter in method.GetParameters())
            {
                Parameters.Add(new ParameterTemplate(parameter));
            }

            if (method.IsGenericMethod)
            {
                foreach (var argumentType in method.GetGenericArguments())
                {
                    var argument = new GenericArgumentTemplate()
                    {
                        Name = argumentType.Name
                    };
                    GenericArguments.Add(argument);

                    if (argumentType.GenericParameterAttributes == GenericParameterAttributes.None &&
                        argumentType.GetGenericParameterConstraints().Length == 0)
                    {
                        continue;
                    }

                    //class约束
                    if (argumentType.GenericParameterAttributes.HasFlag(GenericParameterAttributes.ReferenceTypeConstraint))
                    {
                        argument.Constraints.Add("class");
                    }
                    //值类型约束
                    if (argumentType.GenericParameterAttributes.HasFlag(GenericParameterAttributes.NotNullableValueTypeConstraint))
                    {
                        argument.Constraints.Add("struct");
                    }

                    foreach (var type in argumentType.GetGenericParameterConstraints())
                    {
                        argument.Constraints.Add(new TypeTemplate(type).ToString());
                    }

                    //无参构造函数
                    if (argumentType.GenericParameterAttributes.HasFlag(GenericParameterAttributes.DefaultConstructorConstraint))
                    {
                        argument.Constraints.Add("new()");
                    }
                }
            }
        }
        /// <summary>
        /// Initializes this class.
        /// </summary>
        /// <param name="memberInfo">Represented <see cref="MemberInfo"/></param>
        /// <seealso cref="InterLinqMemberInfo.Initialize"/>
        public override void Initialize(MemberInfo memberInfo)
        {
            base.Initialize(memberInfo);
            MethodInfo methodInfo = memberInfo as MethodInfo;

            ReturnType = InterLinqTypeSystem.Instance.GetInterLinqVersionOf <InterLinqType>(methodInfo.ReturnType);
            IsStatic   = methodInfo.IsStatic;
            if (methodInfo.IsGenericMethod)
            {
                foreach (Type genericArgument in methodInfo.GetGenericArguments())
                {
                    GenericArguments.Add(InterLinqTypeSystem.Instance.GetInterLinqVersionOf <InterLinqType>(genericArgument));
                }
            }
        }
        public static GenericArguments ParseGenericArguments(string type, string path, int absoluteCharOffset)
        {
            GenericArguments generics = new GenericArguments();

            var p = type.IndexOf('<');
            System.Text.StringBuilder s = new System.Text.StringBuilder();
            if (p > -1)
            {
                for (int i = p + 1; i < type.Length; i++)
                {

                    var c = type[i];

                    switch (c)
                    {

                        case '>':
                        case ',':
                            generics.Add(s.ToString().Trim());
                            s.Clear();
                            break;

                        default:
                            s.Append(c);
                            break;
                    }

                }
            }

            string txt = LoadText(path, absoluteCharOffset);
            System.Text.RegularExpressions.MatchCollection matchs = r.Matches(txt);

            foreach (System.Text.RegularExpressions.Match item in matchs)
            {
                string t = item.Value.Substring("where".Length).Trim();
                GenericArgument gen = generics.Resolve(t);
                if (gen != null)
                {
                    t = txt.Substring(item.Index + item.Length + 1).Trim();
                    var m2 = r.Match(t);
                    if (m2.Success)
                        t = t.Substring(0, m2.Index);
                    var constraints = t.Split(',');
                    foreach (string constraint in constraints)
                        gen.AddConstraint(constraint.Trim());
                }
            }

            return generics;
        }