public void TodayDo(TomatoSeed seed) { if (!goalSeeds.Remove(seed)) { throw new Exception("GoalNotebool todayDo fail, seed not exist in the goalSeeds."); } OnDecideTodayDo?.Invoke(seed); }
public TomatoSeed LeaveTodayDo(TomatoSeed seed) { if (!goalSeeds.Remove(seed)) { throw new Exception("GoalNotebool todayDo fail, seed not exist in the goalSeeds."); } OnLeaveTodayDo?.Invoke(seed); return(seed); }
public TomatoPlant(TomatoSeed oriSeed) { seed = oriSeed; remainLifeSeconds = TomatoPlantLifeSeconds; remainRestSeconds = TomatoPlantRestSeconds; giveupRecord = string.Empty; pasuseRecords = new List <string>(); }
public TomatoSeed PlanGoal(string title, string detail, int expectTomatoCount, TOMATO_PRI priority) { var seed = new TomatoSeed(); seed.Title = title; seed.Detail = detail; seed.ExpectTomatoCount = expectTomatoCount; seed.Priority = priority; goalSeeds.Add(seed); return(seed); }
private void addGoal_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(titleEdit.Text) || string.IsNullOrEmpty(detailEdit.Text)) { MessageBox.Show(Properties.Resources.EditorCreateContentEmptyContent, Properties.Resources.EditorCreateContentEmptyCaption, MessageBoxButton.OK); return; } var seed = new TomatoSeed(); seed.Title = titleEdit.Text;; seed.Detail = detailEdit.Text; seed.ExpectTomatoCount = (int)countEdit.Value; seed.Priority = (TOMATO_PRI)priorityEdit.SelectedIndex; ListBoxItem boxItem = new ListBoxItem(); boxItem.Content = seed; goalsList.Items.Add(boxItem); }
public void GiveupSeed(TomatoSeed seed) { goalSeeds.Remove(seed); }
public bool GiveupGoal(TomatoSeed seed) { return(goalSeeds.Remove(seed)); }
public TomatoSeed AddTodayGoal(TomatoSeed seed) { goalSeeds.Add(seed); return(seed); }