コード例 #1
0
        /*============================================================================*/
        /* Private Functions                                                           */
        /*============================================================================*/

        private void HandleContextView(object contextView)
        {
            if (_contextView != null)
            {
                return;
            }
            IContextView castContextView = contextView as IContextView;

            if (castContextView == null)
            {
                return;
            }

            _contextView = castContextView;

            if (_contextViewStateWatcher != null)
            {
                _logger.Warn("A IViewStateWatcher on the context view has already been set");
                return;
            }

            if (!_context.injector.HasDirectMapping(typeof(IViewStateWatcher)))
            {
                _logger.Info("No ViewStateWatcherExtension has been found yet. We will check again at the end of the contextview Configuration");
                _context.AddConfigHandler(new InstanceOfMatcher(typeof(IContextView)), HandleViewStateWatcher);
                return;
            }
            else
            {
                HandleViewStateWatcher(_context.injector.GetInstance(typeof(IViewStateWatcher)));
            }
        }
コード例 #2
0
		/*============================================================================*/
		/* Public Functions                                                           */
		/*============================================================================*/

		public void Extend(IContext context)
		{
			_injector = context.injector;
			_logger = context.GetLogger(this);
			context.AfterInitializing (BeforeInitializing);
			context.AddConfigHandler(new InstanceOfMatcher (typeof(IContextView)), AddContextView);
		}
コード例 #3
0
        /*============================================================================*/
        /* Public Functions                                                           */
        /*============================================================================*/

        public void Extend(IContext context)
        {
            _injector = context.injector;
            _logger   = context.GetLogger(this);
            context.AfterInitializing(BeforeInitializing);
            context.AddConfigHandler(new InstanceOfMatcher(typeof(IContextView)), AddContextView);
        }
コード例 #4
0
        /*============================================================================*/
        /* Public Functions                                                           */
        /*============================================================================*/

        public void Extend(IContext context)
        {
            context.BeforeInitializing(BeforeInitializing);
            _context  = context;
            _injector = context.injector;
            _logger   = context.GetLogger(this);
            _context.AddConfigHandler(new InstanceOfMatcher(typeof(IContextView)), HandleContextView);
            _injector.Map(typeof(IModuleConnector)).ToSingleton(typeof(ModuleConnector));
        }
コード例 #5
0
		/*============================================================================*/
		/* Public Functions                                                           */
		/*============================================================================*/

		public void Extend (IContext context)
		{
			_context = context;
			_logger = context.GetLogger(this);
			
			if(context.injector.HasDirectMapping(typeof(IContextView)))
				HandleContextView(context.injector.GetInstance(typeof(IContextView)));
			else
				context.AddConfigHandler(new InstanceOfMatcher(typeof(IContextView)), HandleContextView);
		}
コード例 #6
0
        /*============================================================================*/
        /* Public Functions                                                           */
        /*============================================================================*/

        public void Extend(IContext context)
        {
            _context = context;
            _logger  = context.GetLogger(this);

            if (context.injector.HasDirectMapping(typeof(IContextView)))
            {
                HandleContextView(context.injector.GetInstance(typeof(IContextView)));
            }
            else
            {
                context.AddConfigHandler(new InstanceOfMatcher(typeof(IContextView)), HandleContextView);
            }
        }