public void RefreshMainWindow() { ToDo.Clear(); Doing.Clear(); Backlog.Clear(); Done.Clear(); var result = readDbDataToDisplay(); foreach (var i in result) { if (i.States == BackLog.State.IsToDo) { ToDo.Add(i); } else if (i.States == BackLog.State.IsDoing) { Doing.Add(i); } else if (i.States == BackLog.State.Backlog) { Backlog.Add(i); } else { Done.Add(i); } } }
private async Task LoadTasks() { var result = await apiService.GetAllTasks(); if (result.HttpResponse.IsSuccessStatusCode) { foreach (var item in result.Data) { switch (item.Status) { case 0: ToDo.Add(ViewModelHelper.Get(item)); break; case 1: Doing.Add(ViewModelHelper.Get(item)); break; case 2: Done.Add(ViewModelHelper.Get(item)); break; } } } }
public void AddTodo(string txtAddBlock = null) { int MaxId = 1; if (_toDo.Count > 0) { MaxId = _toDo.Max(x => x.Id) + 1; } if (TxtTodo == null) { ToDo.Add(new ToDoModel { Id = MaxId, Name = "Task" + MaxId, Complete = false, Description = txtAddBlock, CreatedDate = GetDateNow, UpdatedDate = GetDateNow }); } else { TxtTodo.Description = txtAddBlock; TxtTodo.UpdatedDate = GetDateNow; ToDo.Refresh(); TxtTodo = null; ContentAddToDo = "Add"; } TxtAddBlock = ""; NotifyOfPropertyChange(() => TxtAddBlock); }
void OnDoneItemTapped(object sender, ItemTappedEventArgs e) { var item = ToDone [e.ItemIndex]; item.Completed = false; ToDone.Remove(item); ToDo.Add(item); }
protected void OnDoneUnchecked(object sender, EventArgs args) { var item = FindAssociatedToDoItem(sender as Element, ToDone); if (item != null) { item.Completed = false; ToDone.Remove(item); ToDo.Add(item); } }
public void Track(ushort step, TasksManager manager) { if (manager == null) { throw new ArgumentNullException(nameof(manager)); } ToDo.Add(step, manager.ToDo.Count); InProgress.Add(step, manager.InProgress.Count); Done.Add(step, manager.Done.Count); Cancelled.Add(step, manager.Cancelled.Count); }
public TodoChildViewModel() { ToDo.Add(new ToDoModel { Id = 1, Name = "Task1", Complete = true, Description = "Testing todo 1", CreatedDate = GetDateNow, UpdatedDate = GetDateNow }); ToDo.Add(new ToDoModel { Id = 2, Name = "Task2", Complete = false, Description = "Testing todo 2", CreatedDate = GetDateNow, UpdatedDate = GetDateNow }); ToDo.Add(new ToDoModel { Id = 3, Name = "Task3", Complete = false, Description = "Testing todo 3", CreatedDate = GetDateNow, UpdatedDate = GetDateNow }); }
public void AddNewToDoTest() { var todo = new ToDoItem() { Subject = "Something", Date = DateTime.Now }; var context = new MoqToDoDbContext(); var todoService = new ToDo(context.GetMoqDbContext()); todoService.Add(todo); Assert.IsTrue(todo.Id > 0); }
/// <summary> /// Add new task to the To Do column /// Should not be called directly /// Use TaskProcessor.Post() /// </summary> /// <param name="task"></param> public void AddToDo(SymuTask task) { if (task is null) { throw new ArgumentNullException(nameof(task)); } ToDo.Add(task); // We don't want to track message as Task if (task.Parent is Message) { return; } TaskResult.TotalTasksNumber++; TaskResult.ToDo++; task.SetTasksManager(this); }
/// <summary> /// Method that will refresh all the data in the view. Specifically it will add a backlog item to the new correct Observable list /// This is called from the edit Command, so we after deleted the item from the prvious view, add it to the new view. /// </summary> /// <param name="item">Specific item you want to change to a new listbox in the view</param> public void RefreshMainWindow(BackLog item) { if (item.States == BackLog.State.IsToDo) { ToDo.Add(item); } else if (item.States == BackLog.State.IsDoing) { Doing.Add(item); } else if (item.States == BackLog.State.Backlog) { Backlog.Add(item); } else { Done.Add(item); } }
/// <summary> /// Ctor. Need to read all data from WebAPI (Database), and populate the above ObservableCollections. /// These bind to 4 different listbox in View. /// </summary> public BackLogController() { if (_client.BaseAddress == null) { _client.BaseAddress = new Uri("http://localhost:4200/"); _client.DefaultRequestHeaders.Accept.Clear(); _client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); } var result = readDbDataToDisplay(); foreach (var i in result) { if (i.States == BackLog.State.IsToDo) { ToDo.Add(i); } else if (i.States == BackLog.State.IsDoing) { Doing.Add(i); } else if (i.States == BackLog.State.Backlog) { Backlog.Add(i); } else { Done.Add(i); } } //Here I read settings file for background color of main window. string color = Properties.Settings.Default.Color; var brush = new SolidColorBrush((Color)ColorConverter.ConvertFromString(color)); BackgroundColor = brush; NotifyPropertyChanged(); UpdateChart(); }
private void SplitTask() { Debug.WriteLine($"Number of items in Task: {Task.Count}"); foreach (var task in Task) { switch (task.Progress) { case Progress.ToDo: ToDo.Add(task); break; case Progress.Doing: Doing.Add(task); break; case Progress.Done: Done.Add(task); break; default: break; } } }
public void TaskAdd() { ToDo.Add(new CardViewModel("Info", "NK-2", "Nikita", 3)); }