Esempio n. 1
0
        public DefaultWidgetter(HtmlHelper html)
        {
            _html         = html;
            _childActions = new List <ChildAction>();

            //prozkoumat registrovany kontrollery v zavislosti na atributech akci nahazet do seznamu-> ten vytvorit jen jednou

            var ctrlers = Modules.Controllers;

            foreach (var ctrler in ctrlers)
            {
                foreach (var method in ctrler.GetMethods())
                {
                    var att = (PlacementAttribute)method.GetCustomAttributes(typeof(PlacementAttribute), false).FirstOrDefault();
                    if (att == null)
                    {
                        continue;
                    }
                    var childAction = new ChildAction {
                        Controller = ctrler.Name.Remove(ctrler.Name.IndexOf("Controller")),
                        Method     = method.Name,
                        Position   = att.Position,
                        Template   = att.Template
                    };

                    _childActions.Add(childAction);
                }
            }
        }
Esempio n. 2
0
        public DefaultWidgetter(HtmlHelper html)
        {
            _html = html;
            _childActions = new List<ChildAction>();

            //prozkoumat registrovany kontrollery v zavislosti na atributech akci nahazet do seznamu-> ten vytvorit jen jednou

            var ctrlers = Modules.Controllers;
            foreach (var ctrler in ctrlers)
            {
                foreach (var method in ctrler.GetMethods())
                {
                    var att = (PlacementAttribute) method.GetCustomAttributes(typeof(PlacementAttribute), false).FirstOrDefault();
                    if (att == null) continue;
                    var childAction = new ChildAction {Controller = ctrler.Name.Remove(ctrler.Name.IndexOf("Controller")),
                                                        Method = method.Name,
                                                        Position = att.Position,
                                                        Template = att.Template};

                    _childActions.Add(childAction);
                }
            }
        }