コード例 #1
0
        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}");
            }
        }
コード例 #2
0
 public void RegisterHolder(IServiceHolder holder)
 {
     ServiceHolders.Add(holder);
 }