Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Stojcheska Teodora
Programming_Project
Commits
21c7b826
Commit
21c7b826
authored
Jul 04, 2021
by
Stojcheska Teodora
Browse files
Final Version
parent
c9715f0b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Calendar.cs
View file @
21c7b826
...
...
@@ -160,7 +160,6 @@ public class Calendar
day
.
removeTask
(
task
);
deleteReorderCalendar
(
exception
.
day
.
nextDay
,
day
.
hoursToShift
*
-
1
,
day
);
ErrorInTaskParameters
.
Invoke
();
// notify calendar view about exeption and show error message
}
}
...
...
Day.cs
View file @
21c7b826
...
...
@@ -7,12 +7,13 @@ public class Day
{
public
DateTime
date
{
get
;
set
;
}
public
List
<
Task
>
tasks
{
get
;
set
;
}
// format xx:yy
public
(
int
,
int
)
workingHoursInterval
{
get
;
set
;
}
public
int
workingHours
{
get
;
set
;
}
public
Day
nextDay
{
get
;
set
;
}
public
Day
prevDay
{
get
;
set
;
}
public
Task
this
[
int
i
]
=>
tasks
[
i
];
public
Day
(
DateTime
date
,
List
<
Task
>
tasks
,
(
int
,
int
)
workingHoursInterval
,
int
workingHours
)
{
this
.
date
=
date
;
...
...
@@ -46,14 +47,24 @@ public class Day
return
totalHours
;
}
// hours - optional parameter when adding the task plus the day's totoal hours - will there be space?
public
string
getTimeRangeForTask
(
Task
task
)
{
int
hours
=
workingHoursInterval
.
Item1
;
foreach
(
Task
t
in
tasks
)
{
if
(
t
.
Equals
(
task
))
{
return
$"
{
hours
}
:
{
hours
+
task
.
duration
}
"
;
}
hours
+=
t
.
duration
;
}
return
null
;
}
public
bool
isDayFull
(
int
hours
)
=>
totalHoursTasks
()
+
hours
>=
workingHours
;
// the negative value represents the number of free hours in the day
public
int
hoursToShift
=>
totalHoursTasks
()
-
workingHours
;
// TODO: what happens if we try to insert at the last position
// i.e. we have 3 elems : 7, 1, 2 and we want to add a 6 after the 2
public
void
addTask
(
Task
task
,
int
index
)
{
tasks
.
Insert
(
index
,
task
);
...
...
Forms/CalendarView.cs
View file @
21c7b826
...
...
@@ -3,7 +3,7 @@ using System.Windows.Forms;
namespace
Scheduler.Forms
{
public
partial
class
CalendarView
:
Form
public
class
CalendarView
:
Form
{
/* ------------------------------ Private Widgets ------------------------------*/
private
TableLayoutPanel
TitlePanel
;
...
...
@@ -12,7 +12,6 @@ namespace Scheduler.Forms
private
FlowLayoutPanel
DatePanel
;
private
Label
DateLabel
;
private
Label
CurrentDateLabel
;
private
CheckedListBox
TaskList
;
private
Button
SearchButton
;
private
FlowLayoutPanel
ButtonsPanel
;
private
Button
AddTaskButton
;
...
...
@@ -27,45 +26,60 @@ namespace Scheduler.Forms
private
ToolStripMenuItem
saveDataToolStripMenuItem
;
private
ToolStripMenuItem
preferencesToolStripMenuItem
;
private
ToolStripMenuItem
setWorkingHoursToolStripMenuItem
;
private
DataGridView
TaskList
;
private
DataGridViewTextBoxColumn
Time
;
private
DataGridViewTextBoxColumn
TaskName
;
private
DataGridViewTextBoxColumn
Duration
;
private
ContextMenuStrip
ItemMenuStrip
;
/* ------------------------------ Private Methods ------------------------------*/
private
void
LoadTasks
()
{
this
.
TaskList
.
Item
s
.
Clear
();
this
.
TaskList
.
Row
s
.
Clear
();
if
(
CurrentDay
!=
null
)
{
foreach
(
Task
task
in
CurrentDay
.
tasks
)
TaskList
.
Rows
.
Add
(
CurrentDay
.
tasks
.
Count
);
for
(
int
i
=
0
;
i
<
TaskList
.
RowCount
;
++
i
)
{
this
.
TaskList
.
Items
.
Add
(
task
);
TaskList
.
Rows
[
i
].
Cells
[
"Time"
].
Value
=
CurrentDay
.
getTimeRangeForTask
(
CurrentDay
[
i
]);
TaskList
.
Rows
[
i
].
Cells
[
"TaskName"
].
Value
=
CurrentDay
[
i
].
name
;
TaskList
.
Rows
[
i
].
Cells
[
"Duration"
].
Value
=
CurrentDay
[
i
].
duration
;
TaskList
.
Rows
[
i
].
Tag
=
CurrentDay
[
i
];
}
}
}
private
void
InitializeComponent
()
{
this
.
TitlePanel
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
TitleLabel
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
DatePanel
=
new
System
.
Windows
.
Forms
.
FlowLayoutPanel
();
this
.
DateLabel
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
SearchButton
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
CurrentDateLabel
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
TaskList
=
new
System
.
Windows
.
Forms
.
CheckedListBox
();
this
.
ButtonsPanel
=
new
System
.
Windows
.
Forms
.
FlowLayoutPanel
();
this
.
AddTaskButton
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
NextDayButton
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
PreviousDayButton
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
MainMenu
=
new
System
.
Windows
.
Forms
.
MenuStrip
();
this
.
fIleToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
loadDataToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
saveDataToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
preferencesToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
setWorkingHoursToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
DatePicker
=
new
Scheduler
.
Controls
.
DatePicker
();
DataGridViewCellStyle
dataGridViewCellStyle1
=
new
DataGridViewCellStyle
();
DataGridViewCellStyle
dataGridViewCellStyle2
=
new
DataGridViewCellStyle
();
DataGridViewCellStyle
dataGridViewCellStyle3
=
new
DataGridViewCellStyle
();
this
.
TitlePanel
=
new
TableLayoutPanel
();
this
.
TitleLabel
=
new
Label
();
this
.
DatePanel
=
new
FlowLayoutPanel
();
this
.
DateLabel
=
new
Label
();
this
.
DatePicker
=
new
Controls
.
DatePicker
();
this
.
SearchButton
=
new
Button
();
this
.
CurrentDateLabel
=
new
Label
();
this
.
ButtonsPanel
=
new
FlowLayoutPanel
();
this
.
AddTaskButton
=
new
Button
();
this
.
TaskList
=
new
DataGridView
();
this
.
Time
=
new
DataGridViewTextBoxColumn
();
this
.
TaskName
=
new
DataGridViewTextBoxColumn
();
this
.
Duration
=
new
DataGridViewTextBoxColumn
();
this
.
NextDayButton
=
new
Button
();
this
.
PreviousDayButton
=
new
Button
();
this
.
MainMenu
=
new
MenuStrip
();
this
.
fIleToolStripMenuItem
=
new
ToolStripMenuItem
();
this
.
saveDataToolStripMenuItem
=
new
ToolStripMenuItem
();
this
.
loadDataToolStripMenuItem
=
new
ToolStripMenuItem
();
this
.
preferencesToolStripMenuItem
=
new
ToolStripMenuItem
();
this
.
setWorkingHoursToolStripMenuItem
=
new
ToolStripMenuItem
();
this
.
TitlePanel
.
SuspendLayout
();
this
.
DatePanel
.
SuspendLayout
();
this
.
ButtonsPanel
.
SuspendLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
TaskList
)).
BeginInit
();
this
.
MainMenu
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -76,8 +90,8 @@ namespace Scheduler.Forms
this
.
TitlePanel
.
Controls
.
Add
(
this
.
TitleLabel
,
0
,
0
);
this
.
TitlePanel
.
Controls
.
Add
(
this
.
DatePanel
,
0
,
1
);
this
.
TitlePanel
.
Controls
.
Add
(
this
.
CurrentDateLabel
,
0
,
2
);
this
.
TitlePanel
.
Controls
.
Add
(
this
.
TaskList
,
0
,
3
);
this
.
TitlePanel
.
Controls
.
Add
(
this
.
ButtonsPanel
,
0
,
4
);
this
.
TitlePanel
.
Controls
.
Add
(
this
.
TaskList
,
0
,
3
);
this
.
TitlePanel
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
TitlePanel
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
28
);
this
.
TitlePanel
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
0
);
...
...
@@ -127,6 +141,18 @@ namespace Scheduler.Forms
this
.
DateLabel
.
TabIndex
=
3
;
this
.
DateLabel
.
Text
=
"Date:"
;
//
// DatePicker
//
this
.
DatePicker
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
;
this
.
DatePicker
.
AutoSize
=
true
;
this
.
DatePicker
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
DatePicker
.
Font
=
new
System
.
Drawing
.
Font
(
"Segoe UI"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
0
)));
this
.
DatePicker
.
Location
=
new
System
.
Drawing
.
Point
(
57
,
0
);
this
.
DatePicker
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
0
);
this
.
DatePicker
.
Name
=
"DatePicker"
;
this
.
DatePicker
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
46
);
this
.
DatePicker
.
TabIndex
=
2
;
//
// SearchButton
//
this
.
SearchButton
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
None
;
...
...
@@ -151,18 +177,6 @@ namespace Scheduler.Forms
this
.
CurrentDateLabel
.
Size
=
new
System
.
Drawing
.
Size
(
0
,
37
);
this
.
CurrentDateLabel
.
TabIndex
=
5
;
//
// TaskList
//
this
.
TaskList
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
TaskList
.
Font
=
new
System
.
Drawing
.
Font
(
"Courier New"
,
15.75F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
0
)));
this
.
TaskList
.
FormattingEnabled
=
true
;
this
.
TaskList
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
175
);
this
.
TaskList
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
6
,
0
,
6
,
0
);
this
.
TaskList
.
Name
=
"TaskList"
;
this
.
TaskList
.
Size
=
new
System
.
Drawing
.
Size
(
593
,
698
);
this
.
TaskList
.
TabIndex
=
6
;
this
.
TaskList
.
MouseDown
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
TaskList_MouseDown
);
//
// ButtonsPanel
//
this
.
ButtonsPanel
.
Controls
.
Add
(
this
.
AddTaskButton
);
...
...
@@ -187,6 +201,59 @@ namespace Scheduler.Forms
this
.
AddTaskButton
.
UseVisualStyleBackColor
=
true
;
this
.
AddTaskButton
.
Click
+=
new
System
.
EventHandler
(
this
.
AddTaskButton_Click
);
//
// TaskList
//
this
.
TaskList
.
AllowUserToAddRows
=
false
;
this
.
TaskList
.
AllowUserToDeleteRows
=
false
;
this
.
TaskList
.
AllowUserToOrderColumns
=
true
;
this
.
TaskList
.
ColumnHeadersHeightSizeMode
=
System
.
Windows
.
Forms
.
DataGridViewColumnHeadersHeightSizeMode
.
AutoSize
;
this
.
TaskList
.
Columns
.
AddRange
(
new
System
.
Windows
.
Forms
.
DataGridViewColumn
[]
{
this
.
Time
,
this
.
TaskName
,
this
.
Duration
});
this
.
TaskList
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
TaskList
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
175
);
this
.
TaskList
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
0
);
this
.
TaskList
.
MultiSelect
=
false
;
this
.
TaskList
.
Name
=
"TaskList"
;
this
.
TaskList
.
ReadOnly
=
true
;
this
.
TaskList
.
RowHeadersWidth
=
51
;
this
.
TaskList
.
RowTemplate
.
Height
=
24
;
this
.
TaskList
.
SelectionMode
=
System
.
Windows
.
Forms
.
DataGridViewSelectionMode
.
FullRowSelect
;
this
.
TaskList
.
Size
=
new
System
.
Drawing
.
Size
(
605
,
698
);
this
.
TaskList
.
TabIndex
=
8
;
this
.
TaskList
.
MouseDown
+=
new
System
.
Windows
.
Forms
.
MouseEventHandler
(
this
.
TaskList_MouseDown
);
//
// Time
//
dataGridViewCellStyle1
.
Alignment
=
System
.
Windows
.
Forms
.
DataGridViewContentAlignment
.
MiddleCenter
;
this
.
Time
.
DefaultCellStyle
=
dataGridViewCellStyle1
;
this
.
Time
.
HeaderText
=
"Time"
;
this
.
Time
.
MinimumWidth
=
6
;
this
.
Time
.
Name
=
"Time"
;
this
.
Time
.
ReadOnly
=
true
;
this
.
Time
.
Width
=
125
;
//
// TaskName
//
this
.
TaskName
.
AutoSizeMode
=
System
.
Windows
.
Forms
.
DataGridViewAutoSizeColumnMode
.
Fill
;
dataGridViewCellStyle2
.
Alignment
=
System
.
Windows
.
Forms
.
DataGridViewContentAlignment
.
MiddleLeft
;
this
.
TaskName
.
DefaultCellStyle
=
dataGridViewCellStyle2
;
this
.
TaskName
.
HeaderText
=
"Task Name"
;
this
.
TaskName
.
MinimumWidth
=
6
;
this
.
TaskName
.
Name
=
"TaskName"
;
this
.
TaskName
.
ReadOnly
=
true
;
//
// Duration
//
dataGridViewCellStyle3
.
Alignment
=
System
.
Windows
.
Forms
.
DataGridViewContentAlignment
.
MiddleCenter
;
this
.
Duration
.
DefaultCellStyle
=
dataGridViewCellStyle3
;
this
.
Duration
.
HeaderText
=
"Duration"
;
this
.
Duration
.
MinimumWidth
=
6
;
this
.
Duration
.
Name
=
"Duration"
;
this
.
Duration
.
ReadOnly
=
true
;
this
.
Duration
.
Width
=
125
;
//
// NextDayButton
//
this
.
NextDayButton
.
AutoEllipsis
=
true
;
...
...
@@ -226,50 +293,39 @@ namespace Scheduler.Forms
this
.
saveDataToolStripMenuItem
,
this
.
loadDataToolStripMenuItem
});
this
.
fIleToolStripMenuItem
.
Name
=
"fIleToolStripMenuItem"
;
this
.
fIleToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
46
,
2
6
);
this
.
fIleToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
46
,
2
4
);
this
.
fIleToolStripMenuItem
.
Text
=
"File"
;
//
// loadDataToolStripMenuItem
//
this
.
loadDataToolStripMenuItem
.
Name
=
"loadDataToolStripMenuItem"
;
this
.
loadDataToolStripMenuItem
.
ShortcutKeys
=
((
System
.
Windows
.
Forms
.
Keys
)((
System
.
Windows
.
Forms
.
Keys
.
Control
|
System
.
Windows
.
Forms
.
Keys
.
L
)));
this
.
loadDataToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
224
,
26
);
this
.
loadDataToolStripMenuItem
.
Text
=
"Load Data"
;
this
.
loadDataToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
loadDataToolStripMenuItem_Click
);
//
// saveDataToolStripMenuItem
//
this
.
saveDataToolStripMenuItem
.
Name
=
"saveDataToolStripMenuItem"
;
this
.
saveDataToolStripMenuItem
.
ShortcutKeys
=
((
System
.
Windows
.
Forms
.
Keys
)((
System
.
Windows
.
Forms
.
Keys
.
Control
|
System
.
Windows
.
Forms
.
Keys
.
S
)));
this
.
saveDataToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
2
24
,
26
);
this
.
saveDataToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
2
10
,
26
);
this
.
saveDataToolStripMenuItem
.
Text
=
"Save Data"
;
this
.
saveDataToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
saveDataToolStripMenuItem_Click
);
//
// loadDataToolStripMenuItem
//
this
.
loadDataToolStripMenuItem
.
Name
=
"loadDataToolStripMenuItem"
;
this
.
loadDataToolStripMenuItem
.
ShortcutKeys
=
((
System
.
Windows
.
Forms
.
Keys
)((
System
.
Windows
.
Forms
.
Keys
.
Control
|
System
.
Windows
.
Forms
.
Keys
.
L
)));
this
.
loadDataToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
210
,
26
);
this
.
loadDataToolStripMenuItem
.
Text
=
"Load Data"
;
this
.
loadDataToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
loadDataToolStripMenuItem_Click
);
//
// preferencesToolStripMenuItem
//
this
.
preferencesToolStripMenuItem
.
DropDownItems
.
AddRange
(
new
System
.
Windows
.
Forms
.
ToolStripItem
[]
{
this
.
setWorkingHoursToolStripMenuItem
});
this
.
preferencesToolStripMenuItem
.
Name
=
"preferencesToolStripMenuItem"
;
this
.
preferencesToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
99
,
2
6
);
this
.
preferencesToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
99
,
2
4
);
this
.
preferencesToolStripMenuItem
.
Text
=
"Preferences"
;
//
// setWorkingHoursToolStripMenuItem
//
this
.
setWorkingHoursToolStripMenuItem
.
Name
=
"setWorkingHoursToolStripMenuItem"
;
this
.
setWorkingHoursToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
2
15
,
26
);
this
.
setWorkingHoursToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
2
24
,
26
);
this
.
setWorkingHoursToolStripMenuItem
.
Text
=
"Set Working Hours"
;
//
// DatePicker
//
this
.
DatePicker
.
Anchor
=
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
;
this
.
DatePicker
.
AutoSize
=
true
;
this
.
DatePicker
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
DatePicker
.
Font
=
new
System
.
Drawing
.
Font
(
"Segoe UI"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
0
)));
this
.
DatePicker
.
Location
=
new
System
.
Drawing
.
Point
(
57
,
0
);
this
.
DatePicker
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
0
);
this
.
DatePicker
.
Name
=
"DatePicker"
;
this
.
DatePicker
.
Size
=
new
System
.
Drawing
.
Size
(
180
,
46
);
this
.
DatePicker
.
TabIndex
=
2
;
this
.
setWorkingHoursToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
setWorkingHoursToolStripMenuItem_Click
);
//
// CalendarView
//
...
...
@@ -294,6 +350,7 @@ namespace Scheduler.Forms
this
.
DatePanel
.
PerformLayout
();
this
.
ButtonsPanel
.
ResumeLayout
(
false
);
this
.
ButtonsPanel
.
PerformLayout
();
((
System
.
ComponentModel
.
ISupportInitialize
)(
this
.
TaskList
)).
EndInit
();
this
.
MainMenu
.
ResumeLayout
(
false
);
this
.
MainMenu
.
PerformLayout
();
this
.
ResumeLayout
(
false
);
...
...
@@ -348,13 +405,13 @@ namespace Scheduler.Forms
private
void
TaskList_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
if
(
e
.
Button
==
MouseButtons
.
Right
&&
CurrentDay
.
date
>=
DateTime
.
Now
)
if
(
e
.
Button
==
MouseButtons
.
Right
)
{
int
index
=
TaskList
.
IndexFromPoint
(
e
.
Location
)
;
int
index
=
TaskList
.
HitTest
(
e
.
X
,
e
.
Y
).
RowIndex
;
if
(
index
!=
CheckedListBox
.
NoMatches
)
if
(
index
>
-
1
)
{
TaskList
.
Set
Selected
(
index
,
true
)
;
TaskList
.
Rows
[
index
].
Selected
=
true
;
ItemMenuStrip
.
Show
(
Cursor
.
Position
);
ItemMenuStrip
.
Visible
=
true
;
}
...
...
@@ -377,7 +434,7 @@ namespace Scheduler.Forms
this
.
ItemMenuStrip
=
new
ContextMenuStrip
();
this
.
ItemMenuStrip
.
Items
.
Add
(
"Modify"
,
null
,
(
sender
,
e
)
=>
{
TaskView
view
=
new
TaskView
((
Task
)
TaskList
.
Selected
Item
,
(
t
)
=>
{
TaskView
view
=
new
TaskView
((
Task
)
TaskList
.
Selected
Rows
[
0
].
Tag
,
(
t
)
=>
{
this
.
CurrentDay
.
removeTask
(
t
);
Settings
.
MyCalendar
.
addTask
(
t
);
});
...
...
@@ -386,7 +443,7 @@ namespace Scheduler.Forms
});
this
.
ItemMenuStrip
.
Items
.
Add
(
"Delete"
,
null
,
(
sender
,
e
)
=>
{
Settings
.
MyCalendar
.
deleteTask
(
CurrentDay
,
(
Task
)
TaskList
.
Selected
Item
);
Settings
.
MyCalendar
.
deleteTask
(
CurrentDay
,
(
Task
)
TaskList
.
Selected
Rows
[
0
].
Tag
);
LoadTasks
();
});
...
...
@@ -423,5 +480,13 @@ namespace Scheduler.Forms
Settings
.
Save
(
saveDialog
.
FileName
);
}
}
private
void
setWorkingHoursToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
SetWorkingHoursView
setWorkingHoursView
=
new
SetWorkingHoursView
((
from
,
to
)
=>
{
CurrentDay
.
workingHoursInterval
=
(
from
,
to
);
CurrentDay
.
workingHours
=
to
-
from
;
});
}
}
}
\ No newline at end of file
Forms/CalendarView.resx
deleted
100644 → 0
View file @
c9715f0b
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema
id=
"root"
xmlns=
""
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata=
"urn:schemas-microsoft-com:xml-msdata"
>
<xsd:import
namespace=
"http://www.w3.org/XML/1998/namespace"
/>
<xsd:element
name=
"root"
msdata:IsDataSet=
"true"
>
<xsd:complexType>
<xsd:choice
maxOccurs=
"unbounded"
>
<xsd:element
name=
"metadata"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
use=
"required"
type=
"xsd:string"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"assembly"
>
<xsd:complexType>
<xsd:attribute
name=
"alias"
type=
"xsd:string"
/>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"data"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
<xsd:element
name=
"comment"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"2"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
msdata:Ordinal=
"1"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
msdata:Ordinal=
"3"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
msdata:Ordinal=
"4"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"resheader"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader
name=
"resmimetype"
>
<value>
text/microsoft-resx
</value>
</resheader>
<resheader
name=
"version"
>
<value>
2.0
</value>
</resheader>
<resheader
name=
"reader"
>
<value>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<metadata
name=
"MainMenu.TrayLocation"
type=
"System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
>
<value>
17, 17
</value>
</metadata>
</root>
\ No newline at end of file
Forms/SetWorkingHoursView.Designer.cs
deleted
100644 → 0
View file @
c9715f0b
namespace
Scheduler.Forms
{
partial
class
SetWorkingHoursView
{
/// <summary>
/// Required designer variable.
/// </summary>
private
System
.
ComponentModel
.
IContainer
components
=
null
;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected
override
void
Dispose
(
bool
disposing
)
{
if
(
disposing
&&
(
components
!=
null
))
{
components
.
Dispose
();
}
base
.
Dispose
(
disposing
);
}
#
region
Windows
Form
Designer
generated
code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private
void
InitializeComponent
()
{
this
.
tableLayoutPanel1
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
SuspendLayout
();
//
// tableLayoutPanel1
//
this
.
tableLayoutPanel1
.
ColumnCount
=
2
;
this
.
tableLayoutPanel1
.
ColumnStyles
.
Add
(
new
System
.
Windows
.
Forms
.
ColumnStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tableLayoutPanel1
.
ColumnStyles
.
Add
(
new
System
.
Windows
.
Forms
.
ColumnStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tableLayoutPanel1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
tableLayoutPanel1
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
0
);
this
.
tableLayoutPanel1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
0
);
this
.
tableLayoutPanel1
.
Name
=
"tableLayoutPanel1"
;
this
.
tableLayoutPanel1
.
RowCount
=
2
;
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tableLayoutPanel1
.
Size
=
new
System
.
Drawing
.
Size
(
800
,
450
);
this
.
tableLayoutPanel1
.
TabIndex
=
0
;
//
// SetWorkingHoursView
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
120F
,
120F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Dpi
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
800
,
450
);
this
.
Controls
.
Add
(
this
.
tableLayoutPanel1
);
this
.
Font
=
new
System
.
Drawing
.
Font
(
"Segoe UI"
,
12F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
0
)));
this
.
Name
=
"SetWorkingHoursView"
;
this
.
ShowIcon
=
false
;
this
.
StartPosition
=
System
.
Windows
.
Forms
.
FormStartPosition
.
CenterParent
;
this
.
Text
=
"Set Working Hours"
;
this
.
ResumeLayout
(
false
);
}
#
endregion
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tableLayoutPanel1
;
}
}
\ No newline at end of file
Forms/SetWorkingHoursView.cs
View file @
21c7b826
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
Scheduler.Forms
{
public
partial
class
SetWorkingHoursView
:
Form
public
class
SetWorkingHoursView
:
Form
{
public
SetWorkingHoursView
()
/* ------------------------------ Widgets ------------------------------ */
private
TableLayoutPanel
MainLayout
;
private
Label
TitleLabel
;
private
FlowLayoutPanel
mainFlowPanel
;
private
Label
FromLabel
;