/// <summary>
        /// Uns the register.
        /// </summary>
        /// <param name="handler">The handler.</param>
        public void UnRegister(IPrintHandler handler)
        {
            Guard.ArgumentNotNull(handler, "PrintHandler");

            handler.Enter -= OnEnter;
            handler.Leave -= OnLeave;
        }
        /// <summary>
        /// Registers the specified handler.
        /// </summary>
        /// <param name="handler">The handler.</param>
        public void Register(IPrintHandler handler)
        {
            Guard.ArgumentNotNull(handler, "PrintHandler");

            handler.Enter += new EventHandler(OnEnter);
            handler.Leave += new EventHandler(OnLeave);
        }
        /// <summary>
        /// Registers the specified UI element.
        /// </summary>
        /// <param name="uiElement">The UI element.</param>
        public void Register(object uiElement)
        {
            IPrintHandler handler = FactoryCatalog.GetFactory(uiElement).GetAdapter(uiElement);

            handlers.Add(uiElement, handler);
            Register(handler);
        }
        private void OnEnter(object sender, EventArgs e)
        {
            Microsoft.Practices.CompositeUI.Utility.Guard.TypeIsAssignableFromType(sender.GetType(), typeof(IPrintHandler), "sender");

            activeHandler = (IPrintHandler)sender;
            UpdateCommandStatus();
        }
 private void OnLeave(object sender, EventArgs e)
 {
     activeHandler = null;
     UpdateCommandStatus();
 }
        private void OnEnter(object sender, EventArgs e)
        {
            Microsoft.Practices.CompositeUI.Utility.Guard.TypeIsAssignableFromType(sender.GetType(), typeof(IPrintHandler), "sender");

            activeHandler = (IPrintHandler)sender;
            UpdateCommandStatus();
        }
        /// <summary>
        /// Uns the register.
        /// </summary>
        /// <param name="handler">The handler.</param>
        public void UnRegister(IPrintHandler handler)
        {
            Guard.ArgumentNotNull(handler, "PrintHandler");

            handler.Enter -= OnEnter;
            handler.Leave -= OnLeave;
        }
        /// <summary>
        /// Registers the specified handler.
        /// </summary>
        /// <param name="handler">The handler.</param>
        public void Register(IPrintHandler handler)
        {
            Guard.ArgumentNotNull(handler, "PrintHandler");

            handler.Enter += new EventHandler(OnEnter);
            handler.Leave += new EventHandler(OnLeave);
        }
 private void OnLeave(object sender, EventArgs e)
 {
     activeHandler = null;
     UpdateCommandStatus();
 }
 public LoggerEntityHandlerDecorator(IPrintHandler <TEntity> decorated, ILog logger)
 {
     _decorated = decorated;
     _logger    = logger;
 }
            public void UnregisterPrintHandler(IPrintHandler
							    handler)
            {
                menubar.printMenuItem.Activated -=
                    handler.OnPrintActivated;
            }
            public bool RegisterPrintHandler(IPrintHandler
							  handler)
            {
                this.handler = handler;
                menubar.printMenuItem.Activated +=
                    handler.OnPrintActivated;
                return true;
            }
Beispiel #13
0
 public ValidationEntityHandlerDecorator(IPrintHandler <TEntity> decorated, IValidator <TEntity> validator)
 {
     this.decorated = decorated;
     this.validator = validator;
 }
Beispiel #14
0
 public ValidatePrintHandlerDecorator(IPrintHandler <TRequest, Response> decorated, IValidator <TRequest> validator)
 {
     this.decorated = decorated;
     this.validator = validator;
 }