Skip to content

Commit

Permalink
Merge pull request #6 from symptum/dev
Browse files Browse the repository at this point in the history
Editor v0.0.5
  • Loading branch information
ShankarBUS authored Dec 24, 2024
2 parents 82616c2 + 7b3aabc commit df76fc7
Show file tree
Hide file tree
Showing 98 changed files with 1,923 additions and 927 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Primitives" Version="8.2.241112-preview1" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Segmented" Version="8.2.241112-preview1" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.2.241112-preview1" />
<PackageVersion Include="CommunityToolkit.WinUI.Controls.TokenizingTextBox" Version="8.2.241112-preview1" />
<PackageVersion Include="CsvHelper" Version="33.0.1" />
<PackageVersion Include="CommunityToolkit.WinUI.UI.Controls.DataGrid" Version="7.1.2" />
<PackageVersion Include="HtmlAgilityPack" Version="1.11.71" />
Expand Down
29 changes: 29 additions & 0 deletions src/Symptum.Common/Bootstrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Symptum.Common.Helpers;
using Symptum.Core.Subjects.Books;

namespace Symptum.Common;

public class Bootstrapper
{
public static async Task InitializeAsync()
{
await PackageHelper.InitializeAsync();
StorageHelper.Initialize();
try
{
var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Books/First Year Books.csv"));
string content = await FileIO.ReadTextAsync(file);
BookStore.LoadBooks(content);
file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Books/Second Year Books.csv"));
content = await FileIO.ReadTextAsync(file);
BookStore.LoadBooks(content);
file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Books/Third Year Books.csv"));
content = await FileIO.ReadTextAsync(file);
BookStore.LoadBooks(content);
file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/Books/Final Year Books.csv"));
content = await FileIO.ReadTextAsync(file);
BookStore.LoadBooks(content);
}
catch { }
}
}
3 changes: 1 addition & 2 deletions src/Symptum.Common/Helpers/PackageHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,9 @@ public static async Task<bool> ExportPackageAsync(IPackageResource? package)
if (zipFile != null && zipFile.FileType.Equals(PackageFileExtension, StringComparison.InvariantCultureIgnoreCase)
&& PackageCacheFolder != null && PackagesFolder != null)
{
StorageFolder? targetFolder = await PackageCacheFolder.CreateFolderAsync(zipFile.DisplayName, CreationCollisionOption.ReplaceExisting);
Stream zipStream;
#if __WASM__
var buffer = await FileIO.ReadBufferAsync(zipFile); // OpenStreamForReadAsync() crashes on WASM?
var buffer = await FileIO.ReadBufferAsync(zipFile); // NOTE: OpenStreamForReadAsync() crashes on WASM?
zipStream = new MemoryStream(buffer.ToArray());
#else
zipStream = await zipFile.OpenStreamForReadAsync();
Expand Down
Loading

0 comments on commit df76fc7

Please sign in to comment.