From fe03da6100f562fec641854ef5fbdf76486d8a6b Mon Sep 17 00:00:00 2001 From: syneffort Date: Thu, 22 Feb 2024 16:51:42 +0900 Subject: [PATCH] test --- MyFirstMauiApp/MyFirstMauiApp.sln | 10 +- MyFirstMauiApp/UseRestService/App.xaml | 14 + MyFirstMauiApp/UseRestService/App.xaml.cs | 12 + MyFirstMauiApp/UseRestService/AppShell.xaml | 14 + .../UseRestService/AppShell.xaml.cs | 10 + .../UseRestService/Data/Messages.cs | 16 + MyFirstMauiApp/UseRestService/Data/Part.cs | 37 ++ .../UseRestService/Data/PartManager.cs | 42 ++ MyFirstMauiApp/UseRestService/MainPage.xaml | 41 ++ .../UseRestService/MainPage.xaml.cs | 25 ++ MyFirstMauiApp/UseRestService/MauiProgram.cs | 25 ++ .../UseRestService/Pages/PartsPage.xaml | 12 + .../UseRestService/Pages/PartsPage.xaml.cs | 9 + .../Platforms/Android/AndroidManifest.xml | 6 + .../Platforms/Android/MainActivity.cs | 11 + .../Platforms/Android/MainApplication.cs | 16 + .../Android/Resources/values/colors.xml | 6 + .../Platforms/MacCatalyst/AppDelegate.cs | 10 + .../Platforms/MacCatalyst/Info.plist | 30 ++ .../Platforms/MacCatalyst/Program.cs | 16 + .../UseRestService/Platforms/Tizen/Main.cs | 17 + .../Platforms/Tizen/tizen-manifest.xml | 15 + .../UseRestService/Platforms/Windows/App.xaml | 8 + .../Platforms/Windows/App.xaml.cs | 25 ++ .../Platforms/Windows/Package.appxmanifest | 46 ++ .../Platforms/Windows/app.manifest | 15 + .../Platforms/iOS/AppDelegate.cs | 10 + .../UseRestService/Platforms/iOS/Info.plist | 32 ++ .../UseRestService/Platforms/iOS/Program.cs | 16 + .../Properties/launchSettings.json | 8 + .../Resources/AppIcon/appicon.svg | 4 + .../Resources/AppIcon/appiconfg.svg | 8 + .../Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107168 bytes .../Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111060 bytes .../Resources/Images/dotnet_bot.svg | 93 ++++ .../Resources/Raw/AboutAssets.txt | 15 + .../Resources/Splash/splash.svg | 8 + .../Resources/Styles/Colors.xaml | 44 ++ .../Resources/Styles/Styles.xaml | 405 ++++++++++++++++++ .../UseRestService/UseRestService.csproj | 62 +++ .../ViewModels/PartsViewModel.cs | 13 + 41 files changed, 1205 insertions(+), 1 deletion(-) create mode 100644 MyFirstMauiApp/UseRestService/App.xaml create mode 100644 MyFirstMauiApp/UseRestService/App.xaml.cs create mode 100644 MyFirstMauiApp/UseRestService/AppShell.xaml create mode 100644 MyFirstMauiApp/UseRestService/AppShell.xaml.cs create mode 100644 MyFirstMauiApp/UseRestService/Data/Messages.cs create mode 100644 MyFirstMauiApp/UseRestService/Data/Part.cs create mode 100644 MyFirstMauiApp/UseRestService/Data/PartManager.cs create mode 100644 MyFirstMauiApp/UseRestService/MainPage.xaml create mode 100644 MyFirstMauiApp/UseRestService/MainPage.xaml.cs create mode 100644 MyFirstMauiApp/UseRestService/MauiProgram.cs create mode 100644 MyFirstMauiApp/UseRestService/Pages/PartsPage.xaml create mode 100644 MyFirstMauiApp/UseRestService/Pages/PartsPage.xaml.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Android/AndroidManifest.xml create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Android/MainActivity.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Android/MainApplication.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Android/Resources/values/colors.xml create mode 100644 MyFirstMauiApp/UseRestService/Platforms/MacCatalyst/AppDelegate.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/MacCatalyst/Info.plist create mode 100644 MyFirstMauiApp/UseRestService/Platforms/MacCatalyst/Program.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Tizen/Main.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Tizen/tizen-manifest.xml create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Windows/App.xaml create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Windows/App.xaml.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Windows/Package.appxmanifest create mode 100644 MyFirstMauiApp/UseRestService/Platforms/Windows/app.manifest create mode 100644 MyFirstMauiApp/UseRestService/Platforms/iOS/AppDelegate.cs create mode 100644 MyFirstMauiApp/UseRestService/Platforms/iOS/Info.plist create mode 100644 MyFirstMauiApp/UseRestService/Platforms/iOS/Program.cs create mode 100644 MyFirstMauiApp/UseRestService/Properties/launchSettings.json create mode 100644 MyFirstMauiApp/UseRestService/Resources/AppIcon/appicon.svg create mode 100644 MyFirstMauiApp/UseRestService/Resources/AppIcon/appiconfg.svg create mode 100644 MyFirstMauiApp/UseRestService/Resources/Fonts/OpenSans-Regular.ttf create mode 100644 MyFirstMauiApp/UseRestService/Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 MyFirstMauiApp/UseRestService/Resources/Images/dotnet_bot.svg create mode 100644 MyFirstMauiApp/UseRestService/Resources/Raw/AboutAssets.txt create mode 100644 MyFirstMauiApp/UseRestService/Resources/Splash/splash.svg create mode 100644 MyFirstMauiApp/UseRestService/Resources/Styles/Colors.xaml create mode 100644 MyFirstMauiApp/UseRestService/Resources/Styles/Styles.xaml create mode 100644 MyFirstMauiApp/UseRestService/UseRestService.csproj create mode 100644 MyFirstMauiApp/UseRestService/ViewModels/PartsViewModel.cs diff --git a/MyFirstMauiApp/MyFirstMauiApp.sln b/MyFirstMauiApp/MyFirstMauiApp.sln index 3760832..0c1f8a0 100644 --- a/MyFirstMauiApp/MyFirstMauiApp.sln +++ b/MyFirstMauiApp/MyFirstMauiApp.sln @@ -11,7 +11,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PageLayout", "PageLayout\Pa EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharedResources", "SharedResources\SharedResources.csproj", "{9A9A55D0-AD77-4510-97E7-A345ABFB5C28}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlyoutTabSearch", "FlyoutTabSearch\FlyoutTabSearch.csproj", "{389BD760-810D-45D4-B67A-2B95FB8B5F74}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FlyoutTabSearch", "FlyoutTabSearch\FlyoutTabSearch.csproj", "{389BD760-810D-45D4-B67A-2B95FB8B5F74}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UseRestService", "UseRestService\UseRestService.csproj", "{6878953F-C5FF-4D93-B920-029350FB6B54}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -49,6 +51,12 @@ Global {389BD760-810D-45D4-B67A-2B95FB8B5F74}.Release|Any CPU.ActiveCfg = Release|Any CPU {389BD760-810D-45D4-B67A-2B95FB8B5F74}.Release|Any CPU.Build.0 = Release|Any CPU {389BD760-810D-45D4-B67A-2B95FB8B5F74}.Release|Any CPU.Deploy.0 = Release|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Release|Any CPU.Build.0 = Release|Any CPU + {6878953F-C5FF-4D93-B920-029350FB6B54}.Release|Any CPU.Deploy.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MyFirstMauiApp/UseRestService/App.xaml b/MyFirstMauiApp/UseRestService/App.xaml new file mode 100644 index 0000000..c2e2b5b --- /dev/null +++ b/MyFirstMauiApp/UseRestService/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/MyFirstMauiApp/UseRestService/App.xaml.cs b/MyFirstMauiApp/UseRestService/App.xaml.cs new file mode 100644 index 0000000..e0f24be --- /dev/null +++ b/MyFirstMauiApp/UseRestService/App.xaml.cs @@ -0,0 +1,12 @@ +namespace UseRestService +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + + MainPage = new AppShell(); + } + } +} diff --git a/MyFirstMauiApp/UseRestService/AppShell.xaml b/MyFirstMauiApp/UseRestService/AppShell.xaml new file mode 100644 index 0000000..2ab84d9 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/MyFirstMauiApp/UseRestService/AppShell.xaml.cs b/MyFirstMauiApp/UseRestService/AppShell.xaml.cs new file mode 100644 index 0000000..e6fb281 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace UseRestService +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/MyFirstMauiApp/UseRestService/Data/Messages.cs b/MyFirstMauiApp/UseRestService/Data/Messages.cs new file mode 100644 index 0000000..4bc519d --- /dev/null +++ b/MyFirstMauiApp/UseRestService/Data/Messages.cs @@ -0,0 +1,16 @@ +using CommunityToolkit.Mvvm.Messaging.Messages; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UseRestService.Data +{ + public class RefreshMessage : ValueChangedMessage + { + public RefreshMessage(bool value) : base(value) + { + } + } +} diff --git a/MyFirstMauiApp/UseRestService/Data/Part.cs b/MyFirstMauiApp/UseRestService/Data/Part.cs new file mode 100644 index 0000000..f0250be --- /dev/null +++ b/MyFirstMauiApp/UseRestService/Data/Part.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UseRestService.Data +{ + [Serializable] + public class Part + { + public string PartID { get; set; } + + public string PartName { get; set; } + + public string TheSuppliers { get; set; } + + public string PartType { get; set; } + + public List Suppliers { get; set; } = new List(); + public DateTime PartAvailableDate { get; set; } + + public string SupplierString + { + get + { + string result = String.Empty; + foreach (string supplier in Suppliers) + { + result += $"{supplier}, "; + } + result = result.Trim(',', ' '); + return result; + } + } + } +} diff --git a/MyFirstMauiApp/UseRestService/Data/PartManager.cs b/MyFirstMauiApp/UseRestService/Data/PartManager.cs new file mode 100644 index 0000000..d582cd1 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/Data/PartManager.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UseRestService.Data +{ + public static class PartsManager + { + // TODO: Add fields for BaseAddress, Url, and authorizationKey + static readonly string BaseAddress = "URL GOES HERE"; + static readonly string Url = $"{BaseAddress}/api/"; + + static HttpClient client; + + private static async Task GetClient() + { + throw new NotImplementedException(); + } + + public static async Task> GetAll() + { + throw new NotImplementedException(); + } + + public static async Task Add(string partName, string supplier, string partType) + { + throw new NotImplementedException(); + } + + public static async Task Update(Part part) + { + throw new NotImplementedException(); + } + + public static async Task Delete(string partID) + { + throw new NotImplementedException(); + } + } +} diff --git a/MyFirstMauiApp/UseRestService/MainPage.xaml b/MyFirstMauiApp/UseRestService/MainPage.xaml new file mode 100644 index 0000000..36d13f9 --- /dev/null +++ b/MyFirstMauiApp/UseRestService/MainPage.xaml @@ -0,0 +1,41 @@ + + + + + + + + +