Example #1
0
        private void Start()
        {
            SBOCtrl   = new SBOControl();
            oLog      = new Logs.Logger();
            FirstTime = true;
            LastUpdateDateCurrency = new DateTime(2010, 1, 1);

            HourOfInitUpdate = SBO_VID_Currency.Properties.Settings.Default.HoraInicio;
            HourOfInitUpdate = (HourOfInitUpdate > 23) ? 23 : HourOfInitUpdate;
            HourOfInitUpdate = (HourOfInitUpdate < 18) ? 18 : HourOfInitUpdate;

            oLog.LogMsg("Servicio iniciado", "A", "I");


            SBOCtrl.oLog    = oLog;
            _timer.Interval = 3 * 1000; // 5 Minutos = 300 Seg. - Primera vez espera 3 seg.
            _timer.Tick    += OnTimerTick;

            if (SBO_VID_Currency.Properties.Settings.Default.Consola)
            {
                _timer.Start();
                oLog.TextBoxMsg = null;
                oLog.LogMsg("Timer enabled", "F", "I");
            }
            else
            {
                oLog.TextBoxMsg = this.tbLog;
            }
        }
Example #2
0
        protected override void OnStart(string[] args)
        {
            SBOCtrl   = new SBOControl();
            oLog      = new Logs.Logger();
            FirstTime = true;
            EventLog.WriteEntry("Servicio iniciado.");
            oLog.LogMsg("Servicio iniciado", "A", "I");


            SBOCtrl.oLog     = oLog;
            _timer.Interval  = 20 * 1000; // 20 segundos
            _timer.AutoReset = true;
            _timer.Elapsed  += OnElapsedEvent;
            _timer.Start();

            oLog.LogMsg("Timer enabled", "F", "I");
        }