From 40a61d53969fe1a0bb1cbdc09591bd56ed406c10 Mon Sep 17 00:00:00 2001
From: Max <51083570+DRdrProfessor@users.noreply.github.com>
Date: Fri, 28 Apr 2023 21:58:36 +0200
Subject: [PATCH] Working on guide
---
SharpRss/Models/CategoryItem.cs | 10 +++++++
SharpRss/RssService.cs | 9 ++++++
WebSharpRSS/MainLayout.razor | 4 +--
WebSharpRSS/Models/CategoryTreeItem.cs | 13 ++++++++
WebSharpRSS/Models/FeedTreeItem.cs | 14 +++++++++
WebSharpRSS/Pages/Index.razor | 4 +--
WebSharpRSS/Shared/SideGuide.razor | 41 ++++++++++++++++++++++++++
WebSharpRSS/WebSharpRSS.csproj | 4 ---
WebSharpRSS/_Imports.razor | 1 +
9 files changed, 91 insertions(+), 9 deletions(-)
create mode 100644 SharpRss/Models/CategoryItem.cs
create mode 100644 WebSharpRSS/Models/CategoryTreeItem.cs
create mode 100644 WebSharpRSS/Models/FeedTreeItem.cs
create mode 100644 WebSharpRSS/Shared/SideGuide.razor
diff --git a/SharpRss/Models/CategoryItem.cs b/SharpRss/Models/CategoryItem.cs
new file mode 100644
index 0000000..e61bd5a
--- /dev/null
+++ b/SharpRss/Models/CategoryItem.cs
@@ -0,0 +1,10 @@
+namespace SharpRss.Models
+{
+ public class CategoryItem
+ {
+ public string CategoryId { get; set; }
+ public string CategoryName { get; set; }
+ public string CategoryIcon { get; set; }
+
+ }
+}
\ No newline at end of file
diff --git a/SharpRss/RssService.cs b/SharpRss/RssService.cs
index da99c92..6eea5de 100644
--- a/SharpRss/RssService.cs
+++ b/SharpRss/RssService.cs
@@ -5,6 +5,10 @@ namespace SharpRss
{
public class RssService
{
+ public RssService()
+ {
+ //TODO: Check if db exists else create.
+ }
public async void GetFeeds()
{
//TODO: Load from db or something.
@@ -20,5 +24,10 @@ namespace SharpRss
}
private readonly string[] _feeds = { "https://www.reddit.com/r/freshrss/.rss", "http://fedoramagazine.org/" };
+
+ private void CheckDbExist()
+ {
+
+ }
}
}
\ No newline at end of file
diff --git a/WebSharpRSS/MainLayout.razor b/WebSharpRSS/MainLayout.razor
index 0bf50d7..580c5e7 100644
--- a/WebSharpRSS/MainLayout.razor
+++ b/WebSharpRSS/MainLayout.razor
@@ -11,9 +11,7 @@
SharpRSS
-
- Home
-
+
@Body
diff --git a/WebSharpRSS/Models/CategoryTreeItem.cs b/WebSharpRSS/Models/CategoryTreeItem.cs
new file mode 100644
index 0000000..8a92080
--- /dev/null
+++ b/WebSharpRSS/Models/CategoryTreeItem.cs
@@ -0,0 +1,13 @@
+using System.Collections.Generic;
+using CodeHollow.FeedReader;
+
+namespace WebSharpRSS.Models
+{
+ public class CategoryTreeItem
+ {
+ public string CategoryTitle { get; set; }
+ public string CategoryIcon { get; set; }
+ public bool IsExpanded { get; set; }
+ public HashSet Feeds { get; set; } = new HashSet() { FeedReader.ReadAsync("http://fedoramagazine.org/feed/").Result };
+ }
+}
\ No newline at end of file
diff --git a/WebSharpRSS/Models/FeedTreeItem.cs b/WebSharpRSS/Models/FeedTreeItem.cs
new file mode 100644
index 0000000..b539dfd
--- /dev/null
+++ b/WebSharpRSS/Models/FeedTreeItem.cs
@@ -0,0 +1,14 @@
+using System.Collections.Generic;
+using CodeHollow.FeedReader;
+
+namespace WebSharpRSS.Models
+{
+ public class FeedTreeItem
+ {
+ public FeedTreeItem(Feed feed)
+ {
+ _feed = feed;
+ }
+ private readonly Feed _feed;
+ }
+}
\ No newline at end of file
diff --git a/WebSharpRSS/Pages/Index.razor b/WebSharpRSS/Pages/Index.razor
index 4e11bdf..a8c4e71 100644
--- a/WebSharpRSS/Pages/Index.razor
+++ b/WebSharpRSS/Pages/Index.razor
@@ -1,7 +1,7 @@
@page "/"
@inject RssService _rssService
-
+@*
@for (int i = 0; i < 10; i++)
{
@@ -18,7 +18,7 @@
}
-
+*@
@code {
diff --git a/WebSharpRSS/Shared/SideGuide.razor b/WebSharpRSS/Shared/SideGuide.razor
new file mode 100644
index 0000000..ba8535e
--- /dev/null
+++ b/WebSharpRSS/Shared/SideGuide.razor
@@ -0,0 +1,41 @@
+@using WebSharpRSS.Models
+@using MudBlazor.Utilities
+
+
+
+
+ Home
+
+
+
+
+
+
+
+
+
+
+
+ @feedContext.Title
+
+
+
+
+
+
+
+
+
+
+@code {
+ public HashSet Categories = new HashSet();
+ protected override void OnInitialized()
+ {
+ Categories.Add(new CategoryTreeItem() { CategoryTitle = "Test cat.", CategoryIcon = Icons.Material.Filled.RssFeed });
+ Categories.Add(new CategoryTreeItem() { CategoryTitle = "Blogs", CategoryIcon = Icons.Material.Filled.RssFeed });
+ Categories.Add(new CategoryTreeItem() { CategoryTitle = "Tech", CategoryIcon = Icons.Material.Filled.Computer });
+ Categories.Add(new CategoryTreeItem() { CategoryTitle = "News", CategoryIcon = Icons.Material.Filled.Newspaper });
+ }
+
+ CategoryTreeItem SelectedItem { get; set; }
+}
\ No newline at end of file
diff --git a/WebSharpRSS/WebSharpRSS.csproj b/WebSharpRSS/WebSharpRSS.csproj
index dd3cc12..c561859 100644
--- a/WebSharpRSS/WebSharpRSS.csproj
+++ b/WebSharpRSS/WebSharpRSS.csproj
@@ -15,8 +15,4 @@
-
-
-
-
diff --git a/WebSharpRSS/_Imports.razor b/WebSharpRSS/_Imports.razor
index b2e2f6c..5ba7585 100644
--- a/WebSharpRSS/_Imports.razor
+++ b/WebSharpRSS/_Imports.razor
@@ -4,3 +4,4 @@
@using WebSharpRSS
@using MudBlazor
@using SharpRss
+@using WebSharpRSS.Shared
\ No newline at end of file