From 2abff776404d8ff8a24c0b09ed5d7a90c44bf24d Mon Sep 17 00:00:00 2001 From: Stepan Pilipenko Date: Mon, 10 Nov 2025 21:14:18 +0300 Subject: [PATCH] first --- .gitignore | 3 + App.xaml | 14 + App.xaml.cs | 15 + AppShell.xaml | 14 + AppShell.xaml.cs | 10 + ComanderApp.csproj | 67 +++ ComanderApp.csproj.user | 31 ++ Commander.sln | 25 + FileSystemItem.cs | 10 + FileSystemService.cs | 55 +++ GlobalXmlns.cs | 2 + IFileSystemService.cs | 8 + MainPage.xaml | 94 ++++ MainPage.xaml.cs | 194 ++++++++ MauiProgram.cs | 25 + Platforms/Android/AndroidManifest.xml | 6 + Platforms/Android/MainActivity.cs | 11 + Platforms/Android/MainApplication.cs | 16 + Platforms/Android/Resources/values/colors.xml | 6 + Platforms/MacCatalyst/AppDelegate.cs | 10 + Platforms/MacCatalyst/Entitlements.plist | 14 + Platforms/MacCatalyst/Info.plist | 38 ++ Platforms/MacCatalyst/Program.cs | 16 + Platforms/Tizen/Main.cs | 17 + Platforms/Tizen/tizen-manifest.xml | 15 + 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 + Platforms/iOS/Info.plist | 32 ++ Platforms/iOS/Program.cs | 16 + Platforms/iOS/Resources/PrivacyInfo.xcprivacy | 51 ++ Properties/launchSettings.json | 8 + Resources/AppIcon/appicon.svg | 4 + Resources/AppIcon/appiconfg.svg | 8 + Resources/Fonts/OpenSans-Regular.ttf | Bin 0 -> 107304 bytes Resources/Fonts/OpenSans-Semibold.ttf | Bin 0 -> 111168 bytes Resources/Images/dotnet_bot.png | Bin 0 -> 93437 bytes Resources/Raw/AboutAssets.txt | 15 + Resources/Splash/splash.svg | 8 + Resources/Styles/Colors.xaml | 45 ++ Resources/Styles/Styles.xaml | 440 ++++++++++++++++++ 43 files changed, 1447 insertions(+) create mode 100644 .gitignore create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 AppShell.xaml create mode 100644 AppShell.xaml.cs create mode 100644 ComanderApp.csproj create mode 100644 ComanderApp.csproj.user create mode 100644 Commander.sln create mode 100644 FileSystemItem.cs create mode 100644 FileSystemService.cs create mode 100644 GlobalXmlns.cs create mode 100644 IFileSystemService.cs create mode 100644 MainPage.xaml create mode 100644 MainPage.xaml.cs create mode 100644 MauiProgram.cs create mode 100644 Platforms/Android/AndroidManifest.xml create mode 100644 Platforms/Android/MainActivity.cs create mode 100644 Platforms/Android/MainApplication.cs create mode 100644 Platforms/Android/Resources/values/colors.xml create mode 100644 Platforms/MacCatalyst/AppDelegate.cs create mode 100644 Platforms/MacCatalyst/Entitlements.plist create mode 100644 Platforms/MacCatalyst/Info.plist create mode 100644 Platforms/MacCatalyst/Program.cs create mode 100644 Platforms/Tizen/Main.cs create mode 100644 Platforms/Tizen/tizen-manifest.xml create mode 100644 Platforms/Windows/App.xaml create mode 100644 Platforms/Windows/App.xaml.cs create mode 100644 Platforms/Windows/Package.appxmanifest create mode 100644 Platforms/Windows/app.manifest create mode 100644 Platforms/iOS/AppDelegate.cs create mode 100644 Platforms/iOS/Info.plist create mode 100644 Platforms/iOS/Program.cs create mode 100644 Platforms/iOS/Resources/PrivacyInfo.xcprivacy create mode 100644 Properties/launchSettings.json create mode 100644 Resources/AppIcon/appicon.svg create mode 100644 Resources/AppIcon/appiconfg.svg create mode 100644 Resources/Fonts/OpenSans-Regular.ttf create mode 100644 Resources/Fonts/OpenSans-Semibold.ttf create mode 100644 Resources/Images/dotnet_bot.png create mode 100644 Resources/Raw/AboutAssets.txt create mode 100644 Resources/Splash/splash.svg create mode 100644 Resources/Styles/Colors.xaml create mode 100644 Resources/Styles/Styles.xaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4b82ccd --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.vs/ +bin/ +obj/ diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..8fb5f38 --- /dev/null +++ b/App.xaml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..b4d805a --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,15 @@ +namespace MauiApp1 +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new AppShell()); + } + } +} \ No newline at end of file diff --git a/AppShell.xaml b/AppShell.xaml new file mode 100644 index 0000000..5fb3b39 --- /dev/null +++ b/AppShell.xaml @@ -0,0 +1,14 @@ + + + + + + diff --git a/AppShell.xaml.cs b/AppShell.xaml.cs new file mode 100644 index 0000000..0f7e0cf --- /dev/null +++ b/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace MauiApp1 +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/ComanderApp.csproj b/ComanderApp.csproj new file mode 100644 index 0000000..b8dae84 --- /dev/null +++ b/ComanderApp.csproj @@ -0,0 +1,67 @@ + + + + net9.0-android;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 + + + + + + + Exe + MauiApp1 + true + true + enable + enable + + + MauiApp1 + + + com.companyname.mauiapp1 + + + 1.0 + 1 + + + None + + 15.0 + 15.0 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ComanderApp.csproj.user b/ComanderApp.csproj.user new file mode 100644 index 0000000..cd723ee --- /dev/null +++ b/ComanderApp.csproj.user @@ -0,0 +1,31 @@ + + + + False + net9.0-windows10.0.19041.0 + Windows Machine + + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + \ No newline at end of file diff --git a/Commander.sln b/Commander.sln new file mode 100644 index 0000000..4d16b0a --- /dev/null +++ b/Commander.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36623.8 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComanderApp", "ComanderApp.csproj", "{7342CF38-EC3F-4640-B541-56B49B4AE2D3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7342CF38-EC3F-4640-B541-56B49B4AE2D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7342CF38-EC3F-4640-B541-56B49B4AE2D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7342CF38-EC3F-4640-B541-56B49B4AE2D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7342CF38-EC3F-4640-B541-56B49B4AE2D3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {84F353D3-F18D-4A2E-BB25-B4EA3F7171B1} + EndGlobalSection +EndGlobal diff --git a/FileSystemItem.cs b/FileSystemItem.cs new file mode 100644 index 0000000..8c1da87 --- /dev/null +++ b/FileSystemItem.cs @@ -0,0 +1,10 @@ +namespace MauiApp1 +{ + public class FileSystemItem + { + public string Name { get; set; } + public string FullName { get; set; } + public bool IsDirectory { get; set; } + public string Icon => IsDirectory ? "folder.png" : "file.png"; + } +} diff --git a/FileSystemService.cs b/FileSystemService.cs new file mode 100644 index 0000000..b5e3584 --- /dev/null +++ b/FileSystemService.cs @@ -0,0 +1,55 @@ +namespace MauiApp1 +{ + public class FileSystemService : IFileSystemService + { + public string GetRootPath() + { +#if ANDROID || IOS || MACCATALYST + return FileSystem.Current.AppDataDirectory; +#else + return Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); +#endif + } + + public IEnumerable GetDirectoryContents(string path) + { + if (!Directory.Exists(path)) + return Enumerable.Empty(); + + var items = new List(); + + // Добавляем ".." если не корень + var parent = Directory.GetParent(path); + if (parent != null) + { + items.Add(new FileSystemItem + { + Name = "..", + FullName = parent.FullName, + IsDirectory = true + }); + } + + var dirs = Directory.GetDirectories(path) + .Select(d => new FileSystemItem + { + Name = Path.GetFileName(d), + FullName = d, + IsDirectory = true + }); + + var files = Directory.GetFiles(path) + .Select(f => new FileSystemItem + { + Name = Path.GetFileName(f), + FullName = f, + IsDirectory = false + }); + + items.AddRange(dirs.OrderBy(d => d.Name)); + items.AddRange(files.OrderBy(f => f.Name)); + + return items; + } + } +} diff --git a/GlobalXmlns.cs b/GlobalXmlns.cs new file mode 100644 index 0000000..b7e85bc --- /dev/null +++ b/GlobalXmlns.cs @@ -0,0 +1,2 @@ +[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "MauiApp1")] +[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/maui/global", "MauiApp1.Pages")] diff --git a/IFileSystemService.cs b/IFileSystemService.cs new file mode 100644 index 0000000..a12a594 --- /dev/null +++ b/IFileSystemService.cs @@ -0,0 +1,8 @@ +namespace MauiApp1 +{ + public interface IFileSystemService + { + IEnumerable GetDirectoryContents(string path); + string GetRootPath(); + } +} diff --git a/MainPage.xaml b/MainPage.xaml new file mode 100644 index 0000000..11ac0c9 --- /dev/null +++ b/MainPage.xaml @@ -0,0 +1,94 @@ + + + + + +