예제 #1
0
        private async Task UpdateAsync()
        {
            _categoryTodos = await _client.GetTodosAsync(_currentCategory.Id);

            if (_selectedTodoIndex < 0 ||
                _selectedTodoIndex >= _categoryTodos.Count)
            {
                _selectedTodoIndex = 0;
            }

            var reminders = await _client.GetRemindersAsync();

            if (reminders.Count > 0)
            {
                _popup.SetWindow(5, 2, Console.WindowWidth - 10, 20);
                _popup.IsOpen    = true;
                _popup.Reminders = reminders;
                _state           = AppState.Popup;
            }
            else
            {
                _popup.IsOpen = false;
                _state        = AppState.Running;
            }
        }
예제 #2
0
        public async Task InitAsync()
        {
            _client = new ManagemeHttpClient();

            await _client.LoginAsync(new LoginForm("Seva", "123"));

            _categories = await _client.GetCategoriesAsync();

            _currentCategory = _categories.First();
            _categoryTodos   = await _client.GetTodosAsync(_currentCategory.Id);

            _popup = new ReminderPopup(_client);
        }