Beispiel #1
0
        private void InitializeAppResponders(AppConf[] configs)
        {
            string currentMode = ProcessMode.Current.Mode.ToString();

            configs.Where(c => c.ProcessMode.Equals(currentMode)).Each(ac =>
            {
                OnAppContentResponderInitializing(ac);
                Logger.RestartLoggingThread();
                AppContentResponder responder = new AppContentResponder(this, ac)
                {
                    Logger = Logger
                };
                Subscribers.Each(logger =>
                {
                    logger.RestartLoggingThread();
                    responder.Subscribe(logger);
                });
                string appName = ac.Name.ToLowerInvariant();
                responder.Initialize();
                responder.FileUploading      += (o, a) => FileUploading?.Invoke(o, a);
                responder.FileUploaded       += (o, a) => FileUploaded?.Invoke(o, a);
                responder.Responded          += (r, context) => OnResponded(context);
                responder.NotResponded       += (r, context) => OnNotResponded(context);
                AppContentResponders[appName] = responder;

                OnAppContentResponderInitialized(ac);
            });
        }
Beispiel #2
0
        private void InitializeAppResponders(AppConf[] configs)
        {
            configs.Each(ac =>
            {
                OnAppContentResponderInitializing(ac);
                Logger.RestartLoggingThread();
                AppContentResponder responder = new AppContentResponder(this, ac);
                responder.Logger = Logger;
                Subscribers.Each(logger =>
                {
                    logger.RestartLoggingThread();
                    responder.Subscribe(logger);
                });
                string appName = ac.Name.ToLowerInvariant();
                responder.Initialize();
                responder.FileUploading      += (o, a) => FileUploading?.Invoke(o, a);
                responder.FileUploaded       += (o, a) => FileUploaded?.Invoke(o, a);
                AppContentResponders[appName] = responder;

                OnAppContentResponderInitialized(ac);
            });
        }