Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderBlackman committed May 11, 2022
1 parent f9e46d2 commit fb77fbf
Show file tree
Hide file tree
Showing 34 changed files with 1,044 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .claudiaideconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"BackgroundImageAbsolutePath": "C:\\Users\\Hephaestus\\Pictures\\elephant meets seal.jpg",
"BackgroundImagesDirectoryAbsolutePath": "c:\\users\\hephaestus\\appdata\\local\\microsoft\\visualstudio\\17.0_0c0dd023\\extensions\\yhitju51.knt\\Images",
"ExpandToIDE": true,
"Extensions": ".png, .jpg, .gif, .bmp",
"ImageBackgroundType": 0,
"ImageFadeAnimationInterval": "PT5S",
"ImageStretch": 3,
"IsLimitToMainlyEditorWindow": false,
"LoopSlideshow": true,
"MaxHeight": 0,
"MaxWidth": 0,
"Opacity": 0.1,
"PositionHorizon": 0,
"PositionVertical": 1,
"ShuffleSlideshow": false,
"SoftEdgeX": 0,
"SoftEdgeY": 0,
"TileMode": 0,
"UpdateImageInterval": "PT1M",
"ViewBoxPointX": 0,
"ViewBoxPointY": 0,
"ViewPortHeight": 1,
"ViewPortPointX": 0,
"ViewPortPointY": 0,
"ViewPortWidth": 1
}
14 changes: 14 additions & 0 deletions ForgetMeLock.Backend/Data/NoteContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;

namespace ForgetMeLock.Backend.Data
{
public class NoteContext
{

}
}
15 changes: 15 additions & 0 deletions ForgetMeLock.Backend/ForgetMeLock.Backend.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0-preview3" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.4.22229.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.4.22229.2" />
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions ForgetMeLock.Backend/Model/Category.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ForgetMeLock.Backend.Model
{
public class Category
{

}
}
19 changes: 19 additions & 0 deletions ForgetMeLock.Backend/Model/Mood.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ForgetMeLock.Backend.Model
{
public enum Mood
{
Happy,
Sad,
Worried,
Angry,
Frustrated,
Lovestruck,
Exhausted
}
}
20 changes: 20 additions & 0 deletions ForgetMeLock.Backend/Model/Note.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ForgetMeLock.Backend.Model
{
public class Note
{
public int Id { get; set; }
public string? Title { get; set; }
public DateTime DueTime { get; set; }
public DateTime Created { get; set; } = DateTime.Now;
public string? Content { get; set; } = string.Empty;
public Mood? StateOfMind { get; set; }


}
}
53 changes: 53 additions & 0 deletions ForgetMeLock.Backend/Services/SqliteDS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ForgetMeLock.Backend.Model;
using ForgetMeLock.Backend.Data;

namespace ForgetMeLock.Backend.Services
{
public class SqliteDS
{
private readonly NoteContext context;

public SqliteDS (NoteContext dbContext)
{
this.context = dbContext;
this.context.Database.EnsureCreated();
}

public IEnumerable<Note> GetAll()
{
return this.context.Notes.AsEnumerable();
}

public async Task<Note> GetByIdAsync(int id)
{
return await this.context.Notes.Where(e => e.Id == id).FirstOrDefaultAsync();
}

public async Task UpsertAsync(Note note)
{
//obviously this forbids last name changes
await this.context.Notes.Upsert(note).On(e => new { e.FirstName, e.LastName }).RunAsync();

}

public async Task DeleteAsync(int id)
{
var note = await GetByIdAsync(id);
if (note != null)
{
this.context.Notes.Remove(note);
await this.context.SaveChangesAsync();
}
else
{
Debug.WriteLine($"Failed to delete id {id}");
}
}
}
}
13 changes: 13 additions & 0 deletions ForgetMeLock.Backend/ViewModels/InputViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ForgetMeLock.Backend.ViewModels
{
public class InputViewModel
{

}
}
14 changes: 14 additions & 0 deletions ForgetMeLock.Backend/ViewModels/NotesDueViewModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;

namespace ForgetMeLock.Backend.ViewModels
{
internal class NotesDueViewModel
{
}
}
31 changes: 31 additions & 0 deletions ForgetMeLock.Backend/ViewModels/ObservableNote.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ForgetMeLock.Backend.Model;
using CommunityToolkit.Mvvm.ComponentModel;

namespace ForgetMeLock.Backend.ViewModels
{
public partial class ObservableNote : ObservableObject
{
private readonly Note note;
public ObservableNote(Note note) => this.note = note;

[ObservableProperty]
private int id;
[ObservableProperty]
private string? title;
[ObservableProperty]
private DateTime dueTime;
[ObservableProperty]
private DateTime created;
[ObservableProperty]
private Mood stateOfMind;




}
}
15 changes: 15 additions & 0 deletions ForgetMeLock.UI/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Application
x:Class="ForgetMeLock.UI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ForgetMeLock.UI">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
<!-- Other merged dictionaries here -->
</ResourceDictionary.MergedDictionaries>
<!-- Other app resources here -->
</ResourceDictionary>
</Application.Resources>
</Application>
51 changes: 51 additions & 0 deletions ForgetMeLock.UI/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.UI.Xaml.Shapes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.Foundation;
using Windows.Foundation.Collections;

// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

namespace ForgetMeLock.UI
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
}

/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
m_window = new MainWindow();
m_window.Activate();
}

private Window m_window;
}
}
Binary file added ForgetMeLock.UI/Assets/LockScreenLogo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ForgetMeLock.UI/Assets/SplashScreen.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ForgetMeLock.UI/Assets/Square44x44Logo.scale-200.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ForgetMeLock.UI/Assets/StoreLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions ForgetMeLock.UI/ForgetMeLock.UI.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>ForgetMeLock.UI</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64;arm64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
<DefaultLanguage>en</DefaultLanguage>
</PropertyGroup>
<ItemGroup>
<None Remove="UserControls\MarkdownInputBox.xaml" />
<None Remove="Views\InputPage.xaml" />
<None Remove="Views\NotesDuePage.xaml" />
</ItemGroup>

<ItemGroup>
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\LockScreenLogo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Assets\StoreLogo.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.0.0-preview3" />
<PackageReference Include="CommunityToolkit.WinUI.UI.Controls" Version="7.1.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0-preview.4.22229.2" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.194" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

<!-- Defining the "Msix" ProjectCapability here allows the Single-project MSIX Packaging
Tools extension to be activated for this project even if the Windows App SDK Nuget
package has not yet been restored -->
<ItemGroup Condition="'$(DisableMsixProjectCapabilityAddedByProject)'!='true' and '$(EnablePreviewMsixTooling)'=='true'">
<ProjectCapability Include="Msix" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ForgetMeLock.Backend\ForgetMeLock.Backend.csproj" />
</ItemGroup>
<ItemGroup>
<Page Update="Views\NotesDuePage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="Views\InputPage.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Page Update="UserControls\MarkdownInputBox.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions ForgetMeLock.UI/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Window
x:Class="ForgetMeLock.UI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ForgetMeLock.UI"
xmlns:views="using:ForgetMeLock.UI.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<views:NotesDuePage/>

</Window>
Loading

0 comments on commit fb77fbf

Please sign in to comment.