示例#1
0
        private static List <ActionInfoGroup> ExtractUrlFromController(Type type_controller_current, ConfigJS.JSNamespace JSNamespace, ModelInfo modelInfo)
        {
            List <ActionInfoGroup> urlListTemp = new List <ActionInfoGroup>();

            IGrouping <string, MethodInfo>[] miGroups;
            {
                MethodInfo[] miArray = type_controller_current.GetMethods(BindingFlags.Public |
                                                                          BindingFlags.Instance | BindingFlags.DeclaredOnly);

                miGroups = miArray
                           .Where(x => x.Name.IndexOf("get_") < 0)
                           .GroupBy(x => x.Name).ToArray();
            }


            for (int jj = 0; jj < miGroups.Length; jj++)
            {
                IGrouping <string, MethodInfo> mig_current = miGroups[jj];

                //-- TODO: passer à ActionInfo, plusieurs signatures d'une méthode.
                ActionInfoGroup url = CreateUrl(type_controller_current, mig_current, JSNamespace, modelInfo);
                if (url != null)
                {
                    urlListTemp.Add(url);
                }
            }

            return(urlListTemp);
        }
示例#2
0
        /// <summary>
        /// Creates instance of ActionInfo.
        /// </summary>
        /// <param name="type_controller_current"></param>
        /// <param name="miGroup">differents signatures of one method</param>
        /// <param name="JSNamespace"></param>
        /// <param name="modelInfo"></param>
        /// <returns></returns>
        private static ActionInfoGroup CreateUrl(Type type_controller_current, IGrouping <string, MethodInfo> miGroup, ConfigJS.JSNamespace JSNamespace, ModelInfo modelInfo)
        {
            ActionInfoGroup url = null;

            string area = TryGetArea(type_controller_current);

            url = new ActionInfoGroup(miGroup.Key,
                                      type_controller_current,
                                      area,
                                      miGroup, JSNamespace, modelInfo);


            return(url);
        }