protected override void OnStart(string[] args) { Logger.DebugFormat($"Starting service"); Logger.DebugFormat($"Starting holders"); ServiceHolders.Add(new MarketWatchServiceHolder()); Logger.DebugFormat($"Initializing holders"); try { foreach (IServiceHolder serviceHolder in ServiceHolders) { serviceHolder.Init(); } } catch (Exception e) { Logger.ErrorFormat($"Error on itialization: {e.Message} stactrace: {e.StackTrace}"); } }
public void RegisterHolder(IServiceHolder holder) { ServiceHolders.Add(holder); }