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); }); }
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); }
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); }); }