Esempio n. 1
0
        public Form1()
        {
            InitializeComponent();
            var apiUser = ConfigurationManager.AppSettings["habitUserID"];
            var apiToken = ConfigurationManager.AppSettings["habitToken"];
            var tUser = ConfigurationManager.AppSettings["todoistUser"];
            var tPass = ConfigurationManager.AppSettings["todoistPassword"];

            _hClient = new HabitRPGClient("https://habitrpg.com/api/v2/", apiUser, apiToken);
            _tClient = Todoist.Login(tUser, tPass);

            aTimer = new System.Timers.Timer(900000);

            // Hook up the Elapsed event for the timer.
            aTimer.Elapsed += TodoistToHabit;

            // Set the Interval to 2 seconds (2000 milliseconds).
            aTimer.Interval = 900000;
            aTimer.Enabled = true;
            SetText(string.Format("Next update at {0}", DateTime.Now.AddMinutes(15)));
        }
Esempio n. 2
0
 public HomeController()
 {
     _client = new HabitRPGClient("https://habitrpg.com/api/v2", _userID, _apiKey);
 }