/*============================================================================*/
        /* 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)));
            }
        }
		/*============================================================================*/
		/* Public Functions                                                           */
		/*============================================================================*/

		public void Extend(IContext context)
		{
			_injector = context.injector;
			_logger = context.GetLogger(this);
			context.AfterInitializing (BeforeInitializing);
			context.AddConfigHandler(new InstanceOfMatcher (typeof(IContextView)), AddContextView);
		}
Example #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);
        }
        /*============================================================================*/
        /* 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));
        }
		/*============================================================================*/
		/* 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);
		}
        /*============================================================================*/
        /* 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);
            }
        }