Пример #1
0
        private static void FindResources(Control seed, InsertOrderedDictionary <string, string> scripts, InsertOrderedDictionary <string, string> styles, List <string> ns)
        {
            if (ReflectionUtils.IsTypeOf(seed, typeof(BaseControl), false))
            {
                BaseControl ctrl = (BaseControl)seed;

                ComponentLoader.CheckNS(ctrl, ns);
                ComponentLoader.CheckResources(ctrl, scripts, styles);
                ctrl.EnsureChildControlsInternal();
            }


            foreach (Control control in seed.Controls)
            {
                bool isBaseControl = ReflectionUtils.IsTypeOf(control, typeof(BaseControl), false);

                if (isBaseControl && !(control is UserControlLoader))
                {
                    BaseControl ctrl = (BaseControl)control;
                    ComponentLoader.CheckNS(ctrl, ns);
                    ComponentLoader.CheckResources(ctrl, scripts, styles);
                    ctrl.EnsureChildControlsInternal();
                }

                if (ControlUtils.HasControls(control))
                {
                    ComponentLoader.FindResources(control, scripts, styles, ns);
                }
            }
        }