feat(Documents) Notes/Docs page improvements and warning cleanup
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using DataType = Model.Immortal.Entity.Data.DataType;
|
||||
using DataType = Model.Entity.Data.DataType;
|
||||
|
||||
namespace Services.Website;
|
||||
|
||||
@@ -10,18 +10,18 @@ public class EntityDialogService : IEntityDialogService
|
||||
|
||||
private List<string> history = new List<string>();
|
||||
|
||||
private event Action _onChange;
|
||||
private event Action OnChange = null!;
|
||||
|
||||
private void NotifyDataChanged() {
|
||||
_onChange?.Invoke();
|
||||
OnChange?.Invoke();
|
||||
}
|
||||
|
||||
public void Subscribe(Action action) {
|
||||
_onChange += action;
|
||||
OnChange += action;
|
||||
}
|
||||
|
||||
public void Unsubscribe(Action action) {
|
||||
_onChange += action;
|
||||
OnChange += action;
|
||||
}
|
||||
|
||||
public void AddDialog(string id)
|
||||
|
||||
@@ -7,16 +7,16 @@ public class NavigationService : INavigationService {
|
||||
|
||||
private NavSelectionType navSelectionType = NavSelectionType.None;
|
||||
|
||||
private Type renderType;
|
||||
private Type renderType = null!;
|
||||
private int webPageType;
|
||||
private int webSectionType;
|
||||
|
||||
public void Subscribe(Action action) {
|
||||
_onChange += action;
|
||||
OnChange += action;
|
||||
}
|
||||
|
||||
public void Unsubscribe(Action action) {
|
||||
_onChange += action;
|
||||
OnChange += action;
|
||||
}
|
||||
|
||||
public void ChangeNavigationState(string newState) {
|
||||
@@ -83,13 +83,9 @@ public class NavigationService : INavigationService {
|
||||
return renderType;
|
||||
}
|
||||
|
||||
private event Action _onChange;
|
||||
private event Action OnChange = null!;
|
||||
|
||||
private void NotifyDataChanged() {
|
||||
_onChange?.Invoke();
|
||||
}
|
||||
|
||||
public Action OnChange() {
|
||||
return _onChange;
|
||||
OnChange?.Invoke();
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public class WebsiteService : IWebsiteService {
|
||||
private bool isLoaded;
|
||||
|
||||
|
||||
private event Action _onChange;
|
||||
private event Action OnChange = default!;
|
||||
|
||||
|
||||
public WebsiteService(HttpClient httpClient) {
|
||||
@@ -25,8 +25,8 @@ public class WebsiteService : IWebsiteService {
|
||||
|
||||
|
||||
#if NO_SQL
|
||||
public List<WebSectionModel> WebSectionModels { get; set; }
|
||||
public List<WebPageModel> WebPageModels { get; set; }
|
||||
public List<WebSectionModel> WebSectionModels { get; set; } = default!;
|
||||
public List<WebPageModel> WebPageModels { get; set; } = default!;
|
||||
#else
|
||||
|
||||
private DatabaseContext Database { get; set; }
|
||||
@@ -38,11 +38,11 @@ public class WebsiteService : IWebsiteService {
|
||||
|
||||
|
||||
public void Subscribe(Action action) {
|
||||
_onChange += action;
|
||||
OnChange += action;
|
||||
}
|
||||
|
||||
public void Unsubscribe(Action action) {
|
||||
_onChange -= action;
|
||||
OnChange -= action;
|
||||
}
|
||||
|
||||
public bool IsLoaded() {
|
||||
@@ -54,8 +54,10 @@ public class WebsiteService : IWebsiteService {
|
||||
public async Task Load() {
|
||||
if (isLoaded) {return;}
|
||||
|
||||
WebPageModels = (await httpClient.GetFromJsonAsync<WebPageModel[]>("generated/WebPageModels.json")).ToList();
|
||||
WebSectionModels =(await httpClient.GetFromJsonAsync<WebSectionModel[]>("generated/WebSectionModels.json")).ToList();
|
||||
|
||||
|
||||
WebPageModels = ((await httpClient.GetFromJsonAsync<WebPageModel[]>("generated/WebPageModels.json"))!).ToList();
|
||||
WebSectionModels =((await httpClient.GetFromJsonAsync<WebSectionModel[]>("generated/WebSectionModels.json"))!).ToList();
|
||||
|
||||
isLoaded = true;
|
||||
|
||||
@@ -85,6 +87,6 @@ public class WebsiteService : IWebsiteService {
|
||||
}
|
||||
|
||||
private void NotifyDataChanged() {
|
||||
_onChange?.Invoke();
|
||||
OnChange?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user