private Control GetRootControl()
        {
            Page ctl = new Page();

            WebDependencyInjectionUtils.InjectDependenciesRecursive(ContextRegistry.GetContext(), ctl);
            return(ctl);
        }
示例#2
0
        /// <summary>
        /// Performs DI before adding the control to it's parent
        /// </summary>
        /// <param name="control"></param>
        /// <param name="index"></param>
        protected override void AddedControl(Control control, int index)
        {
            // do DI
            Control configuredControl = WebDependencyInjectionUtils.InjectDependenciesRecursive(_defaultApplicationContext, control);

            if (configuredControl != control)
            {
                _targetControl.SetControlAt(configuredControl, index);
            }
            _targetControl.AddedControl(control, index);
        }
 public override void AddAt(int index, Control child)
 {
     child = WebDependencyInjectionUtils.InjectDependenciesRecursive(_defaultApplicationContext, child);
     base.AddAt(index, child);
 }
 protected override void AddedControl(Control control, int index)
 {
     WebDependencyInjectionUtils.InjectDependenciesRecursive(_defaultApplicationContext, control);
     base.AddedControl(control, index);
 }