コード例 #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);
            });
        }
コード例 #2
0
ファイル: BamServer.cs プロジェクト: dekkerb115/Bam.Net
        public AppContentResponder CreateApp(string appName, string defaultLayout = null, int port = 8080, bool ssl = false)
        {
            AppConf conf = new AppConf(appName, port, ssl);

            if (!string.IsNullOrEmpty(defaultLayout))
            {
                conf.DefaultLayout = defaultLayout;
            }
            OnCreatingApp(conf);

            AppContentResponder responder = new AppContentResponder(ContentResponder, conf);

            responder.Initialize();

            OnCreatedApp(conf);
            return(responder);
        }
コード例 #3
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);
            });
        }