/// <summary>
        /// Initializes a new instance of the <see cref="BusyStateScope"/> class.
        /// </summary>
        /// <param name="mediator">The mediator.</param>
        /// <param name="stateMessage">The state message.</param>
        public BusyStateScope(IManageEventPublication mediator, ICreateApplicationStateMessages stateMessage, BusyState returnState = BusyState.IsIdle)
        {
            Mediator     = mediator;
            StateMessage = stateMessage;
            ReturnState  = returnState;

            Mediator.Publish(StateMessage.Create(BusyState.IsBusy));
        }
        public LoggingScope(
            IManageTextFiles fileManager,
            IManageEventPublication mediator,
            ICreateConsoleMessages factory,
            string fileName,
            string logFilePath)
        {
            File     = fileManager;
            Mediator = mediator;
            Message  = factory;

            FileName    = fileName;
            LogFilePath = logFilePath;

            Text        = string.Empty;
            IsListening = true;

            RegisterMessageHandler();
        }