Пример #1
0
 public Notifier()
 {
     InitializeComponent();
     this.nextHour = DateTime.Now.DayOfYear * 24 + DateTime.Now.Hour + 1;
     //ResetHourSharpTimer();
     WechatTimer.Start();
 }
Пример #2
0
        private void WechatTimer_Tick(object sender, EventArgs e)
        {
            if (this.nextHour <= DateTime.Now.DayOfYear * 24 + DateTime.Now.Hour)
            {
                if (DoScheduleTasks(this.nextHour % 24))
                {
                    this.nextHour++;
                }
            }
            SendMessagesToWechat();
            int seconds  = DateTime.Now.Second;
            int interval = (60 - seconds) * 1000;

            WechatTimer.Interval = interval;
            WechatTimer.Start();
        }