Esempio n. 1
0
        protected TimeMonitor()
        {
            this._targetDate = Configuration.singleton()["newYearDateMonitoringTarget"];

            this._monitorThread = new Thread(monitorThreadMethod);

            this._timezoneList = new Dictionary<DateTime, string>();

            DAL.Select q = new DAL.Select(
                "tz_places",
                "ADDDATE(ADDDATE(\"" + MySqlHelper.EscapeString(this._targetDate) +
                "\", INTERVAL -tz_offset_hours HOUR), INTERVAL -tz_offset_minutes MINUTE)"
                );
            q.setFrom("timezones");
            q.escapeSelects(false);
            q.addOrder(
                new DAL.Select.Order(
                    "ADDDATE(ADDDATE(\"" + MySqlHelper.EscapeString(this._targetDate) +
                    "\", INTERVAL -tz_offset_hours HOUR), INTERVAL -tz_offset_minutes MINUTE)", false, false));

            ArrayList al = DAL.singleton().executeSelect(q);

            foreach (object[] row in al)
            {
                this._timezoneList.Add((DateTime.Parse(new String(Encoding.UTF8.GetChars(((byte[]) (row)[1]))))),
                                 (string) (row[0]));
            }

            this.registerInstance();
            this._monitorThread.Start();
        }