From cf65ede0533b9d83853df2c1da26890065193e3c Mon Sep 17 00:00:00 2001 From: Xerath Date: Wed, 20 Mar 2024 00:37:48 +0700 Subject: [PATCH 1/5] Add localdb for issue --- .../Common/Models/LocalDb/GitHubIssueLocalDbModel.cs | 4 ++-- .../LocalDb/GitHubIssueLocalDbService.cs | 10 ++++++++++ .../Interfaces/LocalDb/IGitHubIssueLocalDbService.cs | 6 ++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 src/Presentations/Windows/Features/Common/Services/Implementations/LocalDb/GitHubIssueLocalDbService.cs create mode 100644 src/Presentations/Windows/Features/Common/Services/Interfaces/LocalDb/IGitHubIssueLocalDbService.cs diff --git a/src/Presentations/Windows/Features/Common/Models/LocalDb/GitHubIssueLocalDbModel.cs b/src/Presentations/Windows/Features/Common/Models/LocalDb/GitHubIssueLocalDbModel.cs index 35e42349..9c173c64 100644 --- a/src/Presentations/Windows/Features/Common/Models/LocalDb/GitHubIssueLocalDbModel.cs +++ b/src/Presentations/Windows/Features/Common/Models/LocalDb/GitHubIssueLocalDbModel.cs @@ -14,8 +14,8 @@ public GitHubIssueLocalDbModel() #endregion #region [ Properties ] - - // control name + [Column("control_name")] + public long ControlName { get; set; } [Column("issue_id")] public long IssueId { get; set; } diff --git a/src/Presentations/Windows/Features/Common/Services/Implementations/LocalDb/GitHubIssueLocalDbService.cs b/src/Presentations/Windows/Features/Common/Services/Implementations/LocalDb/GitHubIssueLocalDbService.cs new file mode 100644 index 00000000..738b51cd --- /dev/null +++ b/src/Presentations/Windows/Features/Common/Services/Implementations/LocalDb/GitHubIssueLocalDbService.cs @@ -0,0 +1,10 @@ +namespace MAUIsland; + +public class GitHubIssueLocalDbService : SQLitePCLRawService, IGitHubIssueLocalDbService +{ + #region [ CTor ] + public GitHubIssueLocalDbService() { + + } + #endregion +} diff --git a/src/Presentations/Windows/Features/Common/Services/Interfaces/LocalDb/IGitHubIssueLocalDbService.cs b/src/Presentations/Windows/Features/Common/Services/Interfaces/LocalDb/IGitHubIssueLocalDbService.cs new file mode 100644 index 00000000..b1437504 --- /dev/null +++ b/src/Presentations/Windows/Features/Common/Services/Interfaces/LocalDb/IGitHubIssueLocalDbService.cs @@ -0,0 +1,6 @@ +namespace MAUIsland; + +public interface IGitHubIssueLocalDbService : ILocalDbService +{ + +} From c8634bb19a992a50e8d9016ac6dde16bceb350d9 Mon Sep 17 00:00:00 2001 From: Strypper Vandel Jason Date: Sat, 23 Mar 2024 20:53:23 +0700 Subject: [PATCH 2/5] New LocalDb GitHub Feature --- src/Core/MAUIsland.Core/MAUIsland.Core.csproj | 1 + src/Core/MAUIsland.Core/ServiceExtension.cs | 21 ++- .../Controls/ProgressBar/ProgressBarPage.xaml | 173 ------------------ .../ServiceExtension.cs | 3 +- .../GitHubIssueLocalDbService.cs | 13 ++ .../Interfaces/IGitHubIssueLocalDbService.cs | 6 + ...and.Features.LocalDbFeatures.GitHub.csproj | 13 ++ .../Models/GitHubIssueLocalDbModel.cs | 41 +++++ .../ServiceExtension.cs | 12 ++ .../BaseLocalEntity.cs | 9 + .../DatabaseSettings.cs | 6 + .../GlobalUsings.cs | 1 + .../ILocalDbService.cs | 11 ++ .../Implementations/SQLitePCLRawService.cs | 42 +++++ .../MAUIsland.Features.LocalDbFeatures.csproj | 14 ++ .../ServiceExtension.cs | 17 ++ .../ActivityIndicatorPageViewModel.cs | 7 +- .../Features/Home/Pages/HomePageViewModel.cs | 14 +- src/Presentations/Windows/MauiProgram.cs | 2 - 19 files changed, 222 insertions(+), 184 deletions(-) delete mode 100644 src/Features/Gallery/Pages/BuiltIn/Controls/ProgressBar/ProgressBarPage.xaml create mode 100644 src/Features/LocalDbFeatures/GitHub/MAUIsland.Features.LocalDbFeatures.GitHub/Implementations/GitHubIssueLocalDbService.cs create mode 100644 src/Features/LocalDbFeatures/GitHub/MAUIsland.Features.LocalDbFeatures.GitHub/Interfaces/IGitHubIssueLocalDbService.cs create mode 100644 src/Features/LocalDbFeatures/GitHub/MAUIsland.Features.LocalDbFeatures.GitHub/MAUIsland.Features.LocalDbFeatures.GitHub.csproj create mode 100644 src/Features/LocalDbFeatures/GitHub/MAUIsland.Features.LocalDbFeatures.GitHub/Models/GitHubIssueLocalDbModel.cs create mode 100644 src/Features/LocalDbFeatures/GitHub/MAUIsland.Features.LocalDbFeatures.GitHub/ServiceExtension.cs create mode 100644 src/Features/LocalDbFeatures/MAUIsland.Features.LocalDbFeatures/BaseLocalEntity.cs create mode 100644 src/Features/LocalDbFeatures/MAUIsland.Features.LocalDbFeatures/DatabaseSettings.cs create mode 100644 src/Features/LocalDbFeatures/MAUIsland.Features.LocalDbFeatures/GlobalUsings.cs create mode 100644 src/Features/LocalDbFeatures/MAUIsland.Features.LocalDbFeatures/ILocalDbService.cs create mode 100644 src/Features/LocalDbFeatures/MAUIsland.Features.LocalDbFeatures/Implementations/SQLitePCLRawService.cs create mode 100644 src/Features/LocalDbFeatures/MAUIsland.Features.LocalDbFeatures/MAUIsland.Features.LocalDbFeatures.csproj create mode 100644 src/Features/LocalDbFeatures/MAUIsland.Features.LocalDbFeatures/ServiceExtension.cs diff --git a/src/Core/MAUIsland.Core/MAUIsland.Core.csproj b/src/Core/MAUIsland.Core/MAUIsland.Core.csproj index 7689ce36..856903b2 100644 --- a/src/Core/MAUIsland.Core/MAUIsland.Core.csproj +++ b/src/Core/MAUIsland.Core/MAUIsland.Core.csproj @@ -38,6 +38,7 @@ + diff --git a/src/Core/MAUIsland.Core/ServiceExtension.cs b/src/Core/MAUIsland.Core/ServiceExtension.cs index 9b9b631c..bf5f501a 100644 --- a/src/Core/MAUIsland.Core/ServiceExtension.cs +++ b/src/Core/MAUIsland.Core/ServiceExtension.cs @@ -1,5 +1,8 @@ using CommunityToolkit.Maui; using CommunityToolkit.Maui.Core; +using Material.Components.Maui.Extensions; +using MAUIsland.Features.LocalDbFeatures; +using MAUIsland.Features.LocalDbFeatures.GitHub; using MAUIsland.GitHubFeatures; using SkiaSharp.Views.Maui.Controls.Hosting; using Xe.AcrylicView; @@ -10,13 +13,29 @@ public static class ServicesExtension { public static MauiAppBuilder InitCore(this MauiAppBuilder builder) { + builder.UseAcrylicView(); builder.UseSkiaSharp(true); + builder.UseMaterialComponents(); builder.UseMauiCommunityToolkit(); builder.UseMauiCommunityToolkitCore(); builder.UseMauiCommunityToolkitMediaElement(); - builder.Services.RegisterLogicProvider(); + + + builder.Services.RegisterGitHubFeatures(); + + + + #region [ LocalDb ] + + var DbName = "mauisland.db"; + var localDbPath = Path.Combine(FileSystem.AppDataDirectory, DbName); + builder.Services.RegisterLocalDbFeatures(localDbPath); + builder.Services.RegisterLocalDbFeaturesGitHub(); + #endregion + + return builder; } } \ No newline at end of file diff --git a/src/Features/Gallery/Pages/BuiltIn/Controls/ProgressBar/ProgressBarPage.xaml b/src/Features/Gallery/Pages/BuiltIn/Controls/ProgressBar/ProgressBarPage.xaml deleted file mode 100644 index 5cb2105f..00000000 --- a/src/Features/Gallery/Pages/BuiltIn/Controls/ProgressBar/ProgressBarPage.xaml +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - The .NET Multi-platform App UI (.NET MAUI) ProgressBar indicates to users that the app is progressing through a lengthy activity. The progress bar is a horizontal bar that is filled to a percentage represented by a double value. - - - ProgressBar defines two properties: - - - - These properties are backed by BindableProperty objects, which means that they can be targets of data bindings, and styled. - - - - - Progress is a double value that represents the current progress as a value from 0 to 1. Progress values less than 0 will be clamped to 0, values greater than 1 will be clamped to 1. The default value of this property is 0. ]]> - - - ProgressColor is a Color values that defines the color of the ProgressBar. ]]> - - - - - - ProgressTo method animates the ProgressBar from its current Progress value to a provided value over time. The method accepts a double progress value, a uint duration in milliseconds, an Easing enum value and returns a Task. The following example demonstrates how to animate a ProgressBar: ]]> - - - - - - - - - - - - - - - - -