Skip to content

Commit fc07331

Browse files
committed
再次修复bug
1 parent d138928 commit fc07331

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

TimeControl/Data/Task.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public Task(string name, TimeSpan duration, bool isFocus, bool isDeepFocus)
2020
public string Name;
2121
public TimeSpan Duration;
2222
public bool IsFocus;
23-
private bool isDeepFocus;
24-
private DateTime startTime = new DateTime(0);
25-
private DateTime endTime;
23+
public bool isDeepFocus;
24+
public DateTime startTime = new DateTime(0);
25+
public DateTime endTime;
2626

2727
public bool IsDeepFocus
2828
{ get { return IsFocus && isDeepFocus; } }

TimeControl/Windows/ControlPanel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private void ControlPanel_Shown(object sender, EventArgs e)//启动隐藏参数
129129

130130
private void PlannerButton_Click(object sender, EventArgs e)
131131
{
132-
Planner planner = new Planner();
132+
Planner planner = new Planner(tasks);
133133
planner.ShowDialog();
134134
ReadTasks();
135135
}

TimeControl/Windows/Planner.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ namespace TimeControl.Windows
77
{
88
public partial class Planner : Form
99
{
10-
private List<Data.Task> tasks = new List<Data.Task>();
10+
private List<Data.Task> tasks;
1111

12-
public Planner()
12+
public Planner(List<Data.Task> tasks)
1313
{
1414
InitializeComponent();
15+
this.tasks=tasks;
16+
foreach(Data.Task task in this.tasks)
17+
{
18+
taskListBox.Items.Add(task);
19+
}
1520
}
1621

1722
private void AddButton_Click(object sender, EventArgs e)

0 commit comments

Comments
 (0)