Skip to content

Commit

Permalink
Load old logs, export to .md, buttons, close tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLarsinator committed Jul 23, 2021
1 parent 6bb91bc commit 09f0cae
Show file tree
Hide file tree
Showing 20 changed files with 226 additions and 204 deletions.
9 changes: 0 additions & 9 deletions RevolveTestDiaryXf/Interfaces/IBaseDiaryEntry.cs

This file was deleted.

14 changes: 0 additions & 14 deletions RevolveTestDiaryXf/Interfaces/IDebrief.cs

This file was deleted.

10 changes: 0 additions & 10 deletions RevolveTestDiaryXf/Interfaces/IDiaryEntry.cs

This file was deleted.

16 changes: 0 additions & 16 deletions RevolveTestDiaryXf/Interfaces/IDiaryGoal.cs

This file was deleted.

13 changes: 0 additions & 13 deletions RevolveTestDiaryXf/Interfaces/ILocation.cs

This file was deleted.

13 changes: 0 additions & 13 deletions RevolveTestDiaryXf/Interfaces/IPerson.cs

This file was deleted.

17 changes: 0 additions & 17 deletions RevolveTestDiaryXf/Interfaces/ISession.cs

This file was deleted.

27 changes: 0 additions & 27 deletions RevolveTestDiaryXf/Interfaces/ITestDay.cs

This file was deleted.

17 changes: 11 additions & 6 deletions RevolveTestDiaryXf/Models/Debrief.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using RevolveTestDiaryXf.Interfaces;
using System;
using System.Collections.Generic;
using System.Text;
using System;

namespace RevolveTestDiaryXf.Models
{
public class Debrief : IDebrief
public class Debrief
{
private string whatWentWell;

Expand All @@ -15,6 +12,14 @@ public string WhatWentWell
set { whatWentWell = value; TriggerAutoSaveEvent?.Invoke(this, this); }
}

public Debrief() { }
public Debrief(string whatWentWell, string whatCanBeImproved, string issuesDiscovered)
{
WhatWentWell = whatWentWell;
WhatCanBeImproved = whatCanBeImproved;
IssuesDiscovered = issuesDiscovered;
}

private string whatCanBeImproved;

public string WhatCanBeImproved
Expand All @@ -32,6 +37,6 @@ public string IssuesDiscovered
}


public event EventHandler<IDebrief> TriggerAutoSaveEvent;
public event EventHandler<Debrief> TriggerAutoSaveEvent;
}
}
19 changes: 17 additions & 2 deletions RevolveTestDiaryXf/Models/DiaryEntry.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
using RevolveTestDiaryXf.Enums;
using RevolveTestDiaryXf.Interfaces;
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text.Json.Serialization;

namespace RevolveTestDiaryXf.Models
{
public class DiaryEntry : IDiaryEntry
public class DiaryEntry
{
public DateTime Timestamp { get; set; }

public DiaryEntry(DateTime timestamp, EntryType entryType, string body)
{
Timestamp = timestamp;
EntryType = entryType;
Body = body;
}
public DiaryEntry()
{

}

public string TimestampString => Timestamp.ToShortTimeString();

[JsonIgnore]
public ObservableCollection<EntryType> EntryTypes => new ObservableCollection<EntryType>(Enum.GetValues(typeof(EntryType)).Cast<EntryType>());
public EntryType EntryType { get; set; }

public string Body { get; set; }
Expand Down
11 changes: 7 additions & 4 deletions RevolveTestDiaryXf/Models/DiaryGoal.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using RevolveTestDiaryXf.Interfaces;
using System;
using System;

namespace RevolveTestDiaryXf.Models
{
public class DiaryGoal : IDiaryGoal
public class DiaryGoal
{
private bool achieved;

Expand Down Expand Up @@ -36,6 +35,10 @@ public DiaryGoal(string goal)
Achieved = false;
}

public event EventHandler<IDiaryGoal> TriggerAutoSaveEvent;
public DiaryGoal()
{

}
public event EventHandler<DiaryGoal> TriggerAutoSaveEvent;
}
}
16 changes: 7 additions & 9 deletions RevolveTestDiaryXf/Models/Person.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
using RevolveTestDiaryXf.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RevolveTestDiaryXf.Models
namespace RevolveTestDiaryXf.Models
{
public class Person : IPerson
public class Person
{
public string Name { get; set; }

public Person(string name)
{
Name = name;
}

public Person()
{

}
}
}
23 changes: 12 additions & 11 deletions RevolveTestDiaryXf/Models/Session.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
using ReactiveUI;
using RevolveTestDiaryXf.Enums;
using RevolveTestDiaryXf.Interfaces;
using RevolveTestDiaryXf.ViewModels;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json.Serialization;

namespace RevolveTestDiaryXf.Models
{
public class Session : ViewModelBase, ISession
public class Session : ViewModelBase
{
public DateTime Timestamp { get; set; }

public string Title { get; set; }
public ObservableCollection<IDiaryEntry> SessionEntries { get; set; }
public ObservableCollection<DiaryEntry> SessionEntries { get; set; }

private string newEntryBody;

[JsonIgnore]
public string NewEntryBody
{
get { return newEntryBody; }
Expand All @@ -27,23 +25,26 @@ public string NewEntryBody

private EntryType entryType;

public event EventHandler<ISession> TriggerAutoSaveEvent;

public event EventHandler<Session> TriggerAutoSaveEvent;
[JsonIgnore]
public EntryType NewEntryType
{
get { return entryType; }
set { entryType = value; }
}

[JsonIgnore]
public ObservableCollection<EntryType> EntryTypes => new ObservableCollection<EntryType>(Enum.GetValues(typeof(EntryType)).Cast<EntryType>());

public Session(string title)
{
Timestamp = DateTime.Now;
Title = title;
SessionEntries = new ObservableCollection<IDiaryEntry>();
SessionEntries = new ObservableCollection<DiaryEntry>();
}

public Session() { }

public void AddDiaryEntryCommand()
{
var diaryEntry = new DiaryEntry(NewEntryType, NewEntryBody);
Expand All @@ -52,7 +53,7 @@ public void AddDiaryEntryCommand()
TriggerAutoSaveEvent?.Invoke(this, this);
}

public void AddDiaryEntry(IDiaryEntry entry)
public void AddDiaryEntry(DiaryEntry entry)
{
SessionEntries.Add(entry);
this.RaisePropertyChanged(nameof(SessionEntries));
Expand Down
Loading

0 comments on commit 09f0cae

Please sign in to comment.