public MainService(string name, MesLog mesLog)
        {
            Name    = name;
            _mesLog = mesLog;
            //
            string _loopSec = ConfigurationManager.AppSettings["loopPeriod"];

            try {
                if (string.IsNullOrEmpty(_loopSec))
                {
                    _loopPeriod = new TimeSpan(0, 0, 10);
                }
                else
                {
                    _loopPeriod = new TimeSpan(0, 0, int.Parse(ConfigurationManager.AppSettings["loopPeriod"]));
                }
            }catch (Exception ex)
            {
                _loopPeriod = new TimeSpan(0, 0, 10);
            }
        }
        public NotifyService(string name, MesLog mesLog)
            : base(name, mesLog)
        {
            try
            {
                //
                _PM_ALT_MESSAGEBO = ObjectContainer.BuildUp <IPM_ALT_MESSAGEBO>();

                _CV_PM_WECHAT_NOTIBO = ObjectContainer.BuildUp <Siemens.Simatic.Wechat.BusinessLogic.ICV_PM_WECHAT_NOTIBO>();
                _PM_WECHAT_NOTIBO    = ObjectContainer.BuildUp <IPM_WECHAT_NOTIBO>();
            }
            catch (Exception e)
            {
                // need EmailService instance to send email only.
            }

            this.SenderUser     = ConfigurationManager.AppSettings["SenderUser"];
            this.SenderPassword = ConfigurationManager.AppSettings["SenderPwd"];
            this.SenderName     = ConfigurationManager.AppSettings["SenderAccount"];
            this.SmtpServer     = ConfigurationManager.AppSettings["SmtpServer"];
            this.SmtpPort       = ConfigurationManager.AppSettings["SmtpPort"];
        }
 public MainService(MesLog mesLog)
     : this("MesService", mesLog)
 {
 }
 public NotifyService(MesLog mesLog)
     : this("NotifyTimer", mesLog)
 {
 }
 public Service1()
 {
     InitializeComponent();
     //
     _mesLog = new MesLog();
 }
Exemple #6
0
 public ServiceController(IList <IService> service, MesLog dataLog)
 {
     _threads  = new List <Thread>();
     _services = service;
     _dataLog  = dataLog;
 }