示例#1
0
 public void TodayDo(TomatoSeed seed)
 {
     if (!goalSeeds.Remove(seed))
     {
         throw new Exception("GoalNotebool todayDo fail, seed not exist in the goalSeeds.");
     }
     OnDecideTodayDo?.Invoke(seed);
 }
示例#2
0
 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);
 }
示例#3
0
        public TomatoPlant(TomatoSeed oriSeed)
        {
            seed = oriSeed;
            remainLifeSeconds = TomatoPlantLifeSeconds;
            remainRestSeconds = TomatoPlantRestSeconds;

            giveupRecord  = string.Empty;
            pasuseRecords = new List <string>();
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
0
 public void GiveupSeed(TomatoSeed seed)
 {
     goalSeeds.Remove(seed);
 }
示例#7
0
 public bool GiveupGoal(TomatoSeed seed)
 {
     return(goalSeeds.Remove(seed));
 }
示例#8
0
 public TomatoSeed AddTodayGoal(TomatoSeed seed)
 {
     goalSeeds.Add(seed);
     return(seed);
 }