コード例 #1
0
        private void InjectProperties()
        {
            WindsorContainer container = new WindsorContainer();
            if (container.LoadInstallers() > 0)
            {
                container.InjectProperties(this);
            }

            foreach (var activity in Activities)
            {
                container.InjectProperties(activity);
            }
        }
コード例 #2
0
 private void InjectProperties()
 {
     WindsorContainer container = new WindsorContainer();
     if (container.LoadInstallers() > 0)
     {
         container.InjectProperties(this);
     }
 }
コード例 #3
0
ファイル: DIWebPart.cs プロジェクト: hereyes/SharePoint.DI
        private void InjectProperties()
        {
            WindsorContainer container = new WindsorContainer();
            if (container.LoadInstallers() > 0)
            {
                container.InjectProperties(this);
            }

            ContainerExtensions.InjectUserControls(this, container);
        }
コード例 #4
0
        private void HttpApplicationOnPreRequestHandlerExecute(object sender, EventArgs eventArgs)
        {
            var page = this.httpApplication.Context.CurrentHandler as Page;
            if (page == null)
            {
                return;
            }

            container = new WindsorContainer();
            if (container.LoadInstallers() > 0)
            {
                container.InjectProperties(page);
                page.PreLoad += (o, args) => InjectUserControls(page, true);
            }
        }
コード例 #5
0
        public static void InjectUserControls(Control parent, WindsorContainer container)
        {
            if (parent == null)
            {
                return;
            }

            foreach (Control control in parent.Controls)
            {
                if (control is UserControl || control is WebPart)
                {
                    container.InjectProperties(control);
                    InjectUserControls(control, container);
                }
            }
        }