Example #1
0
 /// <summary>
 /// Terminates the event managing system.
 /// </summary>
 public void Terminate()
 {
     B1ItemEventDispatcher.Unsubscribe();
     B1MenuEventDispatcher.Unsubscribe();
     B1RightClickEventDispatcher.Unsubscribe();
     B1LayoutKeyEventDispatcher.Unsubscribe();
     B1FormDataEventDispatcher.Unsubscribe();
     ApplicationEventDispatcher.Unsubscribe();
 }
Example #2
0
 private void CreateDispatchers(IApplicationEventsHandler handler)
 {
     ApplicationEventDispatcher  = new ApplicationEventDispatcher(handler);
     B1FormDataEventDispatcher   = new B1FormDataEventDispatcher();
     B1MenuEventDispatcher       = new B1MenuEventDispatcher();
     B1ItemEventDispatcher       = new B1ItemEventDispatcher();
     B1RightClickEventDispatcher = new B1RightClickEventDispatcher();
     B1LayoutKeyEventDispatcher  = new B1LayoutKeyEventDispatcher();
 }
Example #3
0
        private void StartEventDispatchers()
        {
            ApplicationEventDispatcher.Subscribe(application);
            B1ItemEventDispatcher.Subscribe(application);
            B1MenuEventDispatcher.Subscribe(application);
            B1RightClickEventDispatcher.Subscribe(application);
            B1FormDataEventDispatcher.Subscribe(application);
            B1LayoutKeyEventDispatcher.Subscribe(application);

            ApplicationEventDispatcher.EventHandlerError  += OnEventHandlerError;
            B1MenuEventDispatcher.EventHandlerError       += OnEventHandlerError;
            B1RightClickEventDispatcher.EventHandlerError += OnEventHandlerError;
            B1ItemEventDispatcher.EventHandlerError       += OnEventHandlerError;
            B1FormDataEventDispatcher.OnEventHandlerError += OnEventHandlerError;
            B1LayoutKeyEventDispatcher.EventHandlerError  += OnEventHandlerError;
        }
Example #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="B1Session" /> class.
        /// </summary>
        /// <param name="application">
        /// The application.
        /// </param>
        /// <param name="applicationEventsHandler">
        /// The instance responsible for application event handling.
        /// </param>
        /// <param name="mainMenu">
        /// The main menu instance.
        /// </param>
        public B1Session(
            Application application,
            IApplicationEventsHandler applicationEventsHandler,
            [CanBeNull] IMainMenuInstance mainMenu)
        {
            this.application = application;
            assembly         = applicationEventsHandler.GetType().Assembly;
            this.applicationEventsHandler = applicationEventsHandler;
            this.mainMenu = mainMenu ?? new NullMainMenuInstance();

            B1ApplicationEventDispatcher = new B1ApplicationEventDispatcher();
            B1FormDataEventDispatcher    = new B1FormDataEventDispatcher();
            B1MenuEventDispatcher        = new B1MenuEventDispatcher();
            B1ItemEventDispatcher        = new B1ItemEventDispatcher();
            B1RightClickEventDispatcher  = new B1RightClickEventDispatcher();
            B1LayoutKeyEventDispatcher   = new B1LayoutKeyEventDispatcher();
        }