Skip to content

Commit

Permalink
Merge pull request #16 from niilopoutanen/Develop
Browse files Browse the repository at this point in the history
Develop to Main
  • Loading branch information
osaama05 authored Sep 26, 2022
2 parents 5c5456b + f17828f commit a49474a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion TODO-app/TODO-app/FileClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal void WriteFile(List<TaskItem> tasks)
/// <summary>
/// Reads from internal storage. Returns list of Task objects.
/// </summary>
/// <returns></returns>
/// <returns>A list of TaskItems that are in the file</returns>
internal List<TaskItem> ReadFile()
{

Expand Down
15 changes: 8 additions & 7 deletions TODO-app/TODO-app/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ private void BackToMain(object sender, EventArgs e)
imm.HideSoftInputFromWindow(taskNameField.WindowToken, 0);
mainHeader.Visibility = ViewStates.Visible;
createTaskHeader.Visibility = ViewStates.Gone;
scrollBase.Visibility = ViewStates.Visible;
scrollLayout.Visibility = ViewStates.Visible;
taskCountLayout.Visibility = ViewStates.Visible;
taskNameField.Text = "";
Expand Down Expand Up @@ -411,7 +412,7 @@ private void CloseCreateView(object sender, EventArgs e)
DateTime dueDate;
if (mainHeader.Visibility == ViewStates.Gone)
{
if (string.IsNullOrWhiteSpace((taskname)))
if (string.IsNullOrWhiteSpace(taskname))
{
OpenPopup(GetString(Resource.String.invalidName), GetString(Resource.String.invalidNameDesc), "OK");
return;
Expand Down Expand Up @@ -1106,7 +1107,7 @@ private void TaskToggle(object sender, EventArgs e)


/// <summary>
/// Convers pixels to dots per inch
/// Converts pixels to dots per inch
/// </summary>
/// <param name="dpValue"></param>
/// <returns></returns>
Expand All @@ -1119,9 +1120,9 @@ private int DpToPx(int dpValue)
private void CreateTaskItem(string name, DateTime dueDate)
{
TaskItem task = new TaskItem();
task.CreationTime = DateTime.Now;
task.Text = name;
task.DueDate = dueDate;
task.CreationTime = DateTime.Today;
taskList.Add(task);
file.WriteFile(taskList);
}
Expand All @@ -1139,16 +1140,16 @@ private void DeleteTaskItem(string name)
}

}



/// <summary>
/// Checks if the given date is in the given month
/// Returns true if the day is in the month
/// </summary>
/// <param name="day"></param>
/// <param name="month"></param>
/// <param name="year"></param>
/// <returns></returns>
/// <returns>
/// True if the day is in the month
/// </returns>
private bool IsDayInMonth(int day, int month, int year)
{
int amountOfDaysInMonth = DateTime.DaysInMonth(year, month);
Expand Down
2 changes: 1 addition & 1 deletion TODO-app/TODO-app/TODO-app.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<ProductVersion>9</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{82E546DA-FB7A-4724-836E-E7FB0D53DC48}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down
28 changes: 14 additions & 14 deletions TODO-app/TODO-app/TaskItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ namespace TODO_app
{
internal class TaskItem
{
private DateTime creationTime;
private DateTime dueDate;
private string text;
private bool isDone = false;
private DateTime _creationTime;
private DateTime _dueDate;
private string _text;
private bool _isDone = false;

public DateTime CreationTime
{
get { return creationTime; }
set { creationTime = value; }
get { return _creationTime; }
set { _creationTime = value; }
}
public DateTime DueDate
{
get { return dueDate; }
set { dueDate = value; }
get { return _dueDate; }
set { _dueDate = value; }
}
public string Text
{
get { return text; }
set { text = value; }
get { return _text; }
set { _text = value; }
}
public bool IsDone
{
get { return isDone; }
set { isDone = value; }
get { return _isDone; }
set { _isDone = value; }
}

public TaskItem()
Expand All @@ -39,7 +39,7 @@ public TaskItem()
internal static List<TaskItem> SortListByDueDate(List<TaskItem> taskList)
{
var tasks = from t in taskList
orderby t.dueDate
orderby t._dueDate
select t;
return tasks.ToList();
}
Expand All @@ -55,7 +55,7 @@ orderby t.CreationTime

internal static List<TaskItem> SortListByIsDone(List<TaskItem> taskList)
{
taskList.OrderBy(x => x.isDone).ToList();
taskList.OrderBy(x => x._isDone).ToList();
return taskList;
}
}
Expand Down

0 comments on commit a49474a

Please sign in to comment.