├── .all-contributorsrc
├── .editorconfig
├── .gitattributes
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ └── feature_request.yml
├── pull_request_template.md
└── workflows
│ ├── build.yml
│ ├── qodana-scan-pr.yml
│ ├── qodana-scan.yml
│ ├── release-signed.yml
│ ├── snyk-security.yml
│ └── vt-scan-releases.yml
├── .gitignore
├── .gitmodules
├── .idea
├── .idea.CollapseLauncher
│ └── .idea
│ │ ├── .name
│ │ ├── codeStyles
│ │ ├── Project.xml
│ │ └── codeStyleConfig.xml
│ │ ├── discord.xml
│ │ ├── encodings.xml
│ │ ├── icon.svg
│ │ ├── indexLayout.xml
│ │ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ │ ├── projectSettingsUpdater.xml
│ │ └── vcs.xml
└── icon.svg
├── Backup
├── CommunityToolkit.WinUI.Controls.ImageCropper.csproj
├── ReadMe.md
└── unused-app-veyor.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ClearCache.bat
├── CollapseLauncher.sln
├── CollapseLauncher.sln.DotSettings
├── CollapseLauncher.slnx
├── CollapseLauncher
├── App.xaml
├── App.xaml.cs
├── Assets
│ ├── CollapseLauncherLogo.png
│ ├── CollapseLauncherLogoOutlineDark.png
│ ├── CollapseLauncherLogoOutlineLight.png
│ ├── CollapseLauncherLogoSmall.png
│ ├── Fonts
│ │ ├── FontAwesomeBrand6.otf
│ │ ├── FontAwesomeRegular6.otf
│ │ └── FontAwesomeSolid6.otf
│ ├── Images
│ │ ├── GameBackground
│ │ │ ├── genshin.webp
│ │ │ ├── honkai.webp
│ │ │ ├── starrail.webp
│ │ │ └── zzz.webp
│ │ ├── GameIcon
│ │ │ ├── icon-genshin.ico
│ │ │ ├── icon-honkai.ico
│ │ │ ├── icon-starrail.ico
│ │ │ └── icon-zenless.ico
│ │ ├── GameLogo
│ │ │ ├── genshin-logo.png
│ │ │ ├── honkai-logo.png
│ │ │ ├── starrail-logo.png
│ │ │ └── zenless-logo.png
│ │ ├── GameMascot
│ │ │ ├── AiHappy-MonoTransparent.png
│ │ │ ├── AiShocked.png
│ │ │ ├── AponiaFly.png
│ │ │ ├── BangbooShocked.png
│ │ │ ├── BelleGasp.png
│ │ │ ├── PaimonSleep-MonoTransparent.png
│ │ │ ├── PaimonWhat.png
│ │ │ └── PomPomWhat.png
│ │ ├── GamePoster
│ │ │ ├── headerposter_genshin.png
│ │ │ ├── headerposter_honkai.png
│ │ │ ├── headerposter_starrail.png
│ │ │ ├── headerposter_zzz.png
│ │ │ ├── poster_genshin.png
│ │ │ ├── poster_honkai.png
│ │ │ ├── poster_starrail.png
│ │ │ └── poster_zzz.png
│ │ ├── GenshinHDRCalibration
│ │ │ ├── Scene.jxr
│ │ │ ├── Sign.png
│ │ │ └── UI.jxr
│ │ ├── ImageCropperOverlay
│ │ │ ├── normal.png
│ │ │ └── small.png
│ │ └── PageBackground
│ │ │ ├── StartupBackground.png
│ │ │ ├── StartupBackground2.png
│ │ │ ├── default.png
│ │ │ ├── default_genshin.webp
│ │ │ ├── default_honkai.webp
│ │ │ ├── default_starrail.webp
│ │ │ └── default_zzz.webp
│ ├── Presets
│ │ └── Honkai
│ │ │ └── PersonalGraphicsSettingV2.json
│ └── Waifu2X_Models
│ │ ├── scale2.0x_model.bin
│ │ └── scale2.0x_model.param.bin
├── Classes
│ ├── AnimatedVisuals
│ │ └── Lottie
│ │ │ ├── DownloadIcon.cs
│ │ │ ├── DownloadIcon.lottie
│ │ │ ├── LoadingSprite.cs
│ │ │ ├── LoadingSprite.lottie
│ │ │ ├── NewLogoTitleIntro.cs
│ │ │ ├── NewLogoTitleIntro.json
│ │ │ ├── StartGameIcon.cs
│ │ │ ├── StartGameIcon.lottie
│ │ │ ├── UpdateIcon.cs
│ │ │ └── UpdateIcon.lottie
│ ├── CachesManagement
│ │ ├── Honkai
│ │ │ ├── Check.cs
│ │ │ ├── Fetch.cs
│ │ │ ├── HonkaiCache.cs
│ │ │ └── Update.cs
│ │ ├── StarRail
│ │ │ ├── Check.cs
│ │ │ ├── Fetch.cs
│ │ │ ├── StarRailCache.cs
│ │ │ └── Update.cs
│ │ └── Zenless
│ │ │ └── ZenlessCache.cs
│ ├── DiscordPresence
│ │ └── DiscordPresenceManager.cs
│ ├── EventsManagement
│ │ ├── BackgroundActivityManager.cs
│ │ └── EventsHandler.cs
│ ├── Extension
│ │ ├── CancellationTokenExtensions.cs
│ │ ├── FontFamilyExtensions.cs
│ │ ├── NumberExtensions.cs
│ │ ├── ObservableCollectionExtension.cs
│ │ ├── TaskExtensions.TaskAwaitable.cs
│ │ ├── TaskExtensions.cs
│ │ ├── TextBlockExtension.cs
│ │ ├── UIElementExtensions.UnsafeAccessorExtensions.cs
│ │ ├── UIElementExtensions.cs
│ │ └── VelopackLocatorExtension.cs
│ ├── FileDialog
│ │ └── FileDialogHelper.cs
│ ├── FileMigrationProcess
│ │ ├── Events.cs
│ │ ├── FileMigrationProcess.cs
│ │ ├── FileMigrationProcessRef.cs
│ │ ├── IO.cs
│ │ ├── Statics.cs
│ │ └── UIBuilder.cs
│ ├── GameManagement
│ │ ├── GamePlaytime
│ │ │ ├── Context.cs
│ │ │ ├── Playtime.cs
│ │ │ └── RegistryClass
│ │ │ │ └── CollapsePlaytime.cs
│ │ ├── GameSettings
│ │ │ ├── BaseClass
│ │ │ │ ├── ImportExportBase.cs
│ │ │ │ ├── MagicNodeBaseValues.cs
│ │ │ │ ├── ScreenSettingData.cs
│ │ │ │ ├── SettingsBase.cs
│ │ │ │ └── SettingsGameVersionManager.cs
│ │ │ ├── Genshin
│ │ │ │ ├── Context.cs
│ │ │ │ ├── RegistryClass
│ │ │ │ │ ├── Enums
│ │ │ │ │ │ └── Enums.cs
│ │ │ │ │ ├── GeneralData.cs
│ │ │ │ │ ├── GlobalPerfData.cs
│ │ │ │ │ ├── GraphicsData.cs
│ │ │ │ │ ├── ScreenManager.cs
│ │ │ │ │ ├── VisibleBackground.cs
│ │ │ │ │ └── WindowsHDR.cs
│ │ │ │ └── Settings.cs
│ │ │ ├── Honkai
│ │ │ │ ├── Context.cs
│ │ │ │ ├── RegistryClass
│ │ │ │ │ ├── Enums
│ │ │ │ │ │ └── Enums.cs
│ │ │ │ │ ├── GraphicsGrade.cs
│ │ │ │ │ ├── PersonalAudioSetting.cs
│ │ │ │ │ ├── PersonalAudioSettingVolume.cs
│ │ │ │ │ ├── PersonalGraphicsSettingV2.cs
│ │ │ │ │ ├── PhysicsSimulation.cs
│ │ │ │ │ ├── Preset.cs
│ │ │ │ │ └── ScreenSettingData.cs
│ │ │ │ └── Settings.cs
│ │ │ ├── StarRail
│ │ │ │ ├── Context.cs
│ │ │ │ ├── RegistryClass
│ │ │ │ │ ├── BGMVolume.cs
│ │ │ │ │ ├── LocalAudioLanguage.cs
│ │ │ │ │ ├── LocalTextLanguage.cs
│ │ │ │ │ ├── MasterVolume.cs
│ │ │ │ │ ├── Model.cs
│ │ │ │ │ ├── PCResolution.cs
│ │ │ │ │ ├── SFXVolume.cs
│ │ │ │ │ └── VOVolume.cs
│ │ │ │ └── Settings.cs
│ │ │ ├── Universal
│ │ │ │ ├── Context.cs
│ │ │ │ └── RegistryClass
│ │ │ │ │ ├── CollapseMiscSetting.cs
│ │ │ │ │ ├── CollapseScreenSetting.cs
│ │ │ │ │ └── CustomArgs.cs
│ │ │ └── Zenless
│ │ │ │ ├── Context.cs
│ │ │ │ ├── Enums.cs
│ │ │ │ ├── FileClass
│ │ │ │ └── GeneralData.cs
│ │ │ │ ├── JsonProperties
│ │ │ │ └── Properties.cs
│ │ │ │ ├── RegistryClass
│ │ │ │ └── ScreenManager.cs
│ │ │ │ ├── Settings.cs
│ │ │ │ └── Sleepy.cs
│ │ └── Versioning
│ │ │ ├── Extension.cs
│ │ │ ├── GameVersionBase.GameApi.cs
│ │ │ ├── GameVersionBase.GameState.cs
│ │ │ ├── GameVersionBase.IniConfig.cs
│ │ │ ├── GameVersionBase.PresetConfig.cs
│ │ │ ├── GameVersionBase.cs
│ │ │ ├── Genshin
│ │ │ └── VersionCheck.cs
│ │ │ ├── Honkai
│ │ │ └── VersionCheck.cs
│ │ │ ├── StarRail
│ │ │ └── VersionCheck.cs
│ │ │ └── Zenless
│ │ │ └── VersionCheck.cs
│ ├── GamePresetProperty.cs
│ ├── GamePropertyVault.cs
│ ├── GenericJSONContext.cs
│ ├── Helper
│ │ ├── Animation
│ │ │ └── AnimationHelper.cs
│ │ ├── Background
│ │ │ ├── BackgroundMediaUtility.cs
│ │ │ ├── ColorPaletteUtility.cs
│ │ │ └── Loaders
│ │ │ │ ├── IBackgroundMediaLoader.cs
│ │ │ │ ├── MediaPlayerLoader.cs
│ │ │ │ └── StillImageLoader.cs
│ │ ├── Database
│ │ │ ├── DBConfig.cs
│ │ │ └── DBHandler.cs
│ │ ├── FileUtility.cs
│ │ ├── Hash.FileStream.cs
│ │ ├── Hash.StringAndBytes.cs
│ │ ├── Hash.cs
│ │ ├── HighlightableControlProperty.cs
│ │ ├── HttpClientBuilder.Dns.cs
│ │ ├── HttpClientBuilder.cs
│ │ ├── Image
│ │ │ ├── ColorHelper.cs
│ │ │ ├── ImageLoaderHelper.cs
│ │ │ ├── Waifu2X.cs
│ │ │ └── Waifu2XTransform.cs
│ │ ├── JsonConverter
│ │ │ ├── EmptyStringAsNullConverter.cs
│ │ │ ├── Extension.cs
│ │ │ ├── HexStringToBytesConverter.cs
│ │ │ ├── NormalizedPathStringConverter.cs
│ │ │ ├── NotificationActionConverter.cs
│ │ │ ├── RegionResourcePluginValidateConverter.cs
│ │ │ ├── SanitizeUrlStringConverter.cs
│ │ │ ├── ServeV3Converter.cs
│ │ │ └── SlashToBackslashConverter.cs
│ │ ├── LauncherApiLoader
│ │ │ ├── HoYoPlay
│ │ │ │ ├── HoYoPlayLauncherApiLoader.cs
│ │ │ │ ├── HoYoPlayLauncherGameInfo.cs
│ │ │ │ ├── HoYoPlayLauncherNews.cs
│ │ │ │ └── HoYoPlayLauncherResource.cs
│ │ │ ├── ILauncherApi.cs
│ │ │ ├── LauncherApiBase.cs
│ │ │ └── Legacy
│ │ │ │ ├── LauncherGameNews.cs
│ │ │ │ └── LegacyLauncherApiLoader.cs
│ │ ├── Loading
│ │ │ └── LoadingMessageHelper.cs
│ │ ├── Metadata
│ │ │ ├── BHI3LInfo.cs
│ │ │ ├── DataCooker.cs
│ │ │ ├── GameDataTemplate.cs
│ │ │ ├── GameDataVersion.cs
│ │ │ ├── GeneralDataProp.cs
│ │ │ ├── Hashable.cs
│ │ │ ├── LauncherMetadataHelper.cs
│ │ │ ├── MasterKeyConfig.cs
│ │ │ ├── MetadataType.cs
│ │ │ ├── PresetConfig.cs
│ │ │ ├── Stamp.cs
│ │ │ └── SteamGameProp.cs
│ │ ├── PatternMatcher.cs
│ │ ├── SimpleProtectData.cs
│ │ ├── StreamUtility
│ │ │ ├── CopyToStream.cs
│ │ │ ├── JsonFieldToEnumerableStream.cs
│ │ │ └── StreamExtension.cs
│ │ ├── TaskSchedulerHelper.cs
│ │ ├── ThreadPoolThrottle.cs
│ │ ├── Update
│ │ │ └── LauncherUpdateHelper.cs
│ │ └── WindowUtility.cs
│ ├── InstallManagement
│ │ ├── Base
│ │ │ ├── GameInstallPackage.cs
│ │ │ ├── HDiffMap.cs
│ │ │ ├── InstallManagerBase.PkgVersion.cs
│ │ │ ├── InstallManagerBase.Sophon.cs
│ │ │ ├── InstallManagerBase.SophonPatch.cs
│ │ │ └── InstallManagerBase.cs
│ │ ├── GameConversionManagement.cs
│ │ ├── Genshin
│ │ │ ├── GenshinInstall.PkgVersion.cs
│ │ │ └── GenshinInstall.cs
│ │ ├── Honkai
│ │ │ └── HonkaiInstall.cs
│ │ ├── StarRail
│ │ │ └── StarRailInstall.cs
│ │ └── Zenless
│ │ │ └── ZenlessInstall.cs
│ ├── Interfaces
│ │ ├── Class
│ │ │ ├── CacheAsset.cs
│ │ │ ├── CommunityToolsProperty.cs
│ │ │ ├── DeltaPatchProperty.cs
│ │ │ ├── Enums.cs
│ │ │ ├── GamePropertyBase.cs
│ │ │ ├── JSONSerializerHelper.cs
│ │ │ ├── JSONSerializerHelperAsync.cs
│ │ │ ├── ProgressBase.cs
│ │ │ └── Structs.cs
│ │ ├── IAssetEntry.cs
│ │ ├── IBackgroundActivity.cs
│ │ ├── ICache.cs
│ │ ├── ICacheBaseT.cs
│ │ ├── IGameInstallManager.cs
│ │ ├── IGamePlaytime.cs
│ │ ├── IGameSettings.cs
│ │ ├── IGameSettingsUniversal.cs
│ │ ├── IGameSettingsValue.cs
│ │ ├── IGameVersionCheck.cs
│ │ ├── IRepair.cs
│ │ └── IRepairAssetIndex.cs
│ ├── Properties
│ │ ├── AppActivation.cs
│ │ ├── ArgumentParser.cs
│ │ ├── InnerLauncherConfig.cs
│ │ ├── NotificationPushStructure.cs
│ │ └── WindowSizeProp
│ │ │ └── WindowSizeProp.cs
│ ├── RegionManagement
│ │ ├── BridgedNetworkStream.cs
│ │ ├── FallbackCDNUtil.cs
│ │ ├── RegionClasses.cs
│ │ └── RegionManagement.cs
│ ├── RegistryMonitor
│ │ └── RegistryMonitor.cs
│ ├── RepairManagement
│ │ ├── BSDiff.cs
│ │ ├── Genshin
│ │ │ ├── Check.cs
│ │ │ ├── Fetch.Persistent.cs
│ │ │ ├── Fetch.cs
│ │ │ ├── GenshinRepair.cs
│ │ │ └── Repair.cs
│ │ ├── Honkai
│ │ │ ├── Check.cs
│ │ │ ├── Fetch.cs
│ │ │ ├── HonkaiRepair.cs
│ │ │ └── Repair.cs
│ │ ├── StarRail
│ │ │ ├── Check.cs
│ │ │ ├── Fetch.cs
│ │ │ ├── Repair.cs
│ │ │ └── StarRailRepair.cs
│ │ └── Zenless
│ │ │ ├── ZenlessRepair.Check.cs
│ │ │ ├── ZenlessRepair.Extensions.cs
│ │ │ ├── ZenlessRepair.Fetch.cs
│ │ │ ├── ZenlessRepair.Repair.cs
│ │ │ ├── ZenlessRepair.cs
│ │ │ └── ZenlessResManifest.cs
│ ├── ShortcutCreator
│ │ ├── ShortcutCreator.cs
│ │ ├── SteamShortcut.cs
│ │ └── SteamShortcutParser.cs
│ └── WinRT
│ │ └── MaterialHelperTestApi.cs
├── CollapseLauncher.csproj
├── CollapseLauncher.csproj.DotSettings
├── Lib
│ ├── libomp140.x86_64.dll
│ ├── waifu2x-ncnn-vulkan.commitinfo
│ └── waifu2x-ncnn-vulkan.dll
├── Misc
│ └── InstallMediaPack.cmd
├── NonTrimmableRoots.xml
├── Program.cs
├── Properties
│ ├── PublishProfiles
│ │ ├── Publish-DebugCIRelease.pubxml
│ │ ├── Publish-DebugCIReleaseAOT.pubxml
│ │ ├── Publish-PreviewRelease.pubxml
│ │ ├── Publish-PreviewReleaseAOT.pubxml
│ │ ├── Publish-StableRelease.pubxml
│ │ └── Publish-StableReleaseAOT.pubxml
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ └── launchSettings.json
├── StaticLib
│ ├── 7za.exe
│ ├── StaticLib.7z.001
│ ├── StaticLib.7z.002
│ ├── StaticLib.7z.003
│ ├── StaticLib.7z.004
│ ├── StaticLib.7z.005
│ ├── StaticLib.7z.006
│ ├── StaticLib.7z.007
│ ├── StaticLib.7z.008
│ ├── StaticLib.7z.009
│ ├── StaticLib.7z.010
│ ├── StaticLib.7z.011
│ ├── StaticLib.7z.012
│ ├── StaticLib.7z.013
│ ├── StaticLib.7z.014
│ ├── StaticLib.7z.015
│ ├── StaticLib.7z.016
│ ├── StaticLib.7z.017
│ ├── StaticLib.7z.018
│ ├── StaticLib.7z.019
│ ├── StaticLib.7z.020
│ ├── StaticLib.7z.021
│ ├── StaticLib.7z.022
│ ├── StaticLib.7z.023
│ ├── StaticLib.7z.024
│ ├── StaticLib.7z.025
│ ├── StaticLib.7z.026
│ ├── StaticLib.7z.027
│ └── StaticLib.7z.028
├── XAMLs
│ ├── Invoker
│ │ └── Classes
│ │ │ ├── Migrate.cs
│ │ │ └── TakeOwnership.cs
│ ├── MainApp
│ │ ├── DisconnectedPage.xaml
│ │ ├── DisconnectedPage.xaml.cs
│ │ ├── MainPage.Background.cs
│ │ ├── MainPage.KeyboardShortcut.cs
│ │ ├── MainPage.Navigation.cs
│ │ ├── MainPage.Notification.cs
│ │ ├── MainPage.xaml
│ │ ├── MainPage.xaml.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Pages
│ │ │ ├── BlankPage.xaml
│ │ │ ├── BlankPage.xaml.cs
│ │ │ ├── CachesPage.xaml
│ │ │ ├── CachesPage.xaml.cs
│ │ │ ├── Dialogs
│ │ │ │ ├── InstallationConvert.xaml
│ │ │ │ ├── InstallationConvert.xaml.cs
│ │ │ │ ├── KeyboardShortcuts.cs
│ │ │ │ └── SimpleDialogs.cs
│ │ │ ├── FileCleanupPage.xaml
│ │ │ ├── FileCleanupPage.xaml.cs
│ │ │ ├── GameSettingsPages
│ │ │ │ ├── GenshinGameSettingsPage.Ext.cs
│ │ │ │ ├── GenshinGameSettingsPage.xaml
│ │ │ │ ├── GenshinGameSettingsPage.xaml.cs
│ │ │ │ ├── HonkaiGameSettingsPage.Ext.cs
│ │ │ │ ├── HonkaiGameSettingsPage.xaml
│ │ │ │ ├── HonkaiGameSettingsPage.xaml.cs
│ │ │ │ ├── StarRailGameSettingsPage.Ext.cs
│ │ │ │ ├── StarRailGameSettingsPage.xaml
│ │ │ │ ├── StarRailGameSettingsPage.xaml.cs
│ │ │ │ ├── ZenlessGameSettingsPage.Ext.cs
│ │ │ │ ├── ZenlessGameSettingsPage.xaml
│ │ │ │ └── ZenlessGameSettingsPage.xaml.cs
│ │ │ ├── HomePage.BindingHelper.cs
│ │ │ ├── HomePage.GameLauncher.cs
│ │ │ ├── HomePage.GameManagement.cs
│ │ │ ├── HomePage.Misc.cs
│ │ │ ├── HomePage.Playtime.cs
│ │ │ ├── HomePage.Variable.cs
│ │ │ ├── HomePage.xaml
│ │ │ ├── HomePage.xaml.cs
│ │ │ ├── MarkdownFramePage.xaml
│ │ │ ├── MarkdownFramePage.xaml.cs
│ │ │ ├── NotInstalledPage.xaml
│ │ │ ├── NotInstalledPage.xaml.cs
│ │ │ ├── NullPage.xaml
│ │ │ ├── NullPage.xaml.cs
│ │ │ ├── OOBE
│ │ │ │ ├── OOBEAgreementMenu.xaml
│ │ │ │ ├── OOBEAgreementMenu.xaml.cs
│ │ │ │ ├── OOBESelectGame.xaml
│ │ │ │ ├── OOBESelectGame.xaml.cs
│ │ │ │ ├── OOBESelectGameBG.xaml
│ │ │ │ ├── OOBESelectGameBG.xaml.cs
│ │ │ │ ├── OOBEStartUpMenu.xaml
│ │ │ │ └── OOBEStartUpMenu.xaml.cs
│ │ │ ├── RepairPage.xaml
│ │ │ ├── RepairPage.xaml.cs
│ │ │ ├── SettingsContext
│ │ │ │ └── DnsSettingsContext.cs
│ │ │ ├── SettingsPage.xaml
│ │ │ ├── SettingsPage.xaml.cs
│ │ │ ├── UnavailablePage.xaml
│ │ │ ├── UnavailablePage.xaml.cs
│ │ │ ├── UnhandledExceptionPage.xaml
│ │ │ ├── UnhandledExceptionPage.xaml.cs
│ │ │ ├── UpdatePage.xaml
│ │ │ └── UpdatePage.xaml.cs
│ │ ├── TrayIcon.xaml
│ │ ├── TrayIcon.xaml.cs
│ │ ├── ValueConverters.cs
│ │ ├── WebView2FramePage.xaml
│ │ └── WebView2FramePage.xaml.cs
│ ├── Prototype
│ │ ├── MainPageNew.xaml
│ │ └── MainPageNew.xaml.cs
│ ├── Theme
│ │ ├── ContentDialogCollapse.xaml
│ │ ├── ContentDialogOverlay.xaml
│ │ ├── CustomControls
│ │ │ ├── CommunityToolkit.Labs
│ │ │ │ ├── CODE_OF_CONDUCT.md
│ │ │ │ ├── CommitInfo
│ │ │ │ ├── Contributing.md
│ │ │ │ ├── DataTable
│ │ │ │ │ ├── DataColumn.cs
│ │ │ │ │ ├── DataColumn.xaml
│ │ │ │ │ ├── DataRow.cs
│ │ │ │ │ └── DataTable.cs
│ │ │ │ ├── License.md
│ │ │ │ ├── MarkdownTextBlock
│ │ │ │ │ ├── DefaultSVGRenderer.cs
│ │ │ │ │ ├── Extensions.cs
│ │ │ │ │ ├── HtmlWriter.cs
│ │ │ │ │ ├── IImageProvider.cs
│ │ │ │ │ ├── ISVGRenderer.cs
│ │ │ │ │ ├── MarkdownConfig.cs
│ │ │ │ │ ├── MarkdownTextBlock.xaml
│ │ │ │ │ ├── MarkdownTextBlock.xaml.cs
│ │ │ │ │ ├── MarkdownThemes.cs
│ │ │ │ │ ├── Renderers
│ │ │ │ │ │ ├── ObjectRenderers
│ │ │ │ │ │ │ ├── CodeBlockRenderer.cs
│ │ │ │ │ │ │ ├── Extensions
│ │ │ │ │ │ │ │ ├── TableRenderer.cs
│ │ │ │ │ │ │ │ └── TaskListRenderer.cs
│ │ │ │ │ │ │ ├── HeadingRenderer.cs
│ │ │ │ │ │ │ ├── HtmlBlockRenderer.cs
│ │ │ │ │ │ │ ├── Inlines
│ │ │ │ │ │ │ │ ├── AutoLinkInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── CodeInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── ContainerInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── DelimiterInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── EmphasisInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── HtmlEntityInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── HtmlInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── LineBreakInlineRenderer.cs
│ │ │ │ │ │ │ │ ├── LinkInlineRenderer.cs
│ │ │ │ │ │ │ │ └── LiteralInlineRenderer.cs
│ │ │ │ │ │ │ ├── ListRenderer.cs
│ │ │ │ │ │ │ ├── ParagraphRenderer.cs
│ │ │ │ │ │ │ ├── QuoteBlockRenderer.cs
│ │ │ │ │ │ │ └── ThematicBreakRenderer.cs
│ │ │ │ │ │ ├── UWPObjectRenderer.cs
│ │ │ │ │ │ └── WinUIRenderer.cs
│ │ │ │ │ └── TextElements
│ │ │ │ │ │ ├── Html
│ │ │ │ │ │ ├── MyBlock.cs
│ │ │ │ │ │ ├── MyDetails.cs
│ │ │ │ │ │ └── MyInline.cs
│ │ │ │ │ │ ├── HtmlElementType.cs
│ │ │ │ │ │ ├── IAddChild.cs
│ │ │ │ │ │ ├── MyAutolinkInline.cs
│ │ │ │ │ │ ├── MyBlockContainer.cs
│ │ │ │ │ │ ├── MyCodeBlock.cs
│ │ │ │ │ │ ├── MyEmphasisInline.cs
│ │ │ │ │ │ ├── MyFlowDocument.cs
│ │ │ │ │ │ ├── MyHeading.cs
│ │ │ │ │ │ ├── MyHyperlink.cs
│ │ │ │ │ │ ├── MyHyperlinkButton.cs
│ │ │ │ │ │ ├── MyImage.cs
│ │ │ │ │ │ ├── MyInlineCode.cs
│ │ │ │ │ │ ├── MyInlineText.cs
│ │ │ │ │ │ ├── MyLineBreak.cs
│ │ │ │ │ │ ├── MyList.cs
│ │ │ │ │ │ ├── MyParagraph.cs
│ │ │ │ │ │ ├── MyQuote.cs
│ │ │ │ │ │ ├── MyTable.cs
│ │ │ │ │ │ ├── MyTableCell.cs
│ │ │ │ │ │ ├── MyTableRow.cs
│ │ │ │ │ │ ├── MyTableUIElement.cs
│ │ │ │ │ │ ├── MyTaskListCheckBox.cs
│ │ │ │ │ │ └── MyThematicBreak.cs
│ │ │ │ └── ReadMe.md
│ │ │ ├── CompressedTextBlock.cs
│ │ │ ├── ContentDialogCollapse.cs
│ │ │ ├── ContentDialogOverlay.cs
│ │ │ ├── ImageEx
│ │ │ │ └── ImageEx.xaml
│ │ │ └── UserFeedbackDialog
│ │ │ │ ├── UserFeedbackDialog.Constants.cs
│ │ │ │ ├── UserFeedbackDialog.Properties.cs
│ │ │ │ ├── UserFeedbackDialog.cs
│ │ │ │ └── UserFeedbackDialog.xaml
│ │ ├── FlipView.xaml
│ │ ├── NavigationView_ThemeResource.xaml
│ │ ├── RadioButton.xaml
│ │ └── Slider.xaml
│ └── Updater
│ │ ├── Classes
│ │ └── Updater.cs
│ │ ├── UpdaterWindow.xaml
│ │ └── UpdaterWindow.xaml.cs
├── aot-locale-cleanup.bat
├── app.manifest
├── icon.ico
└── packages.lock.json
├── Docs
├── Imgs
│ └── CollapseLauncherIdolType.png
├── LICENSE
│ ├── Facebook
│ │ └── ZSTANDARD.LICENSE
│ ├── Google
│ │ └── PROTOBUF.LICENSE
│ ├── LLVM
│ │ └── OPENMP.LICENSE
│ ├── Mendsley
│ │ └── BSDIFF.LICENSE
│ ├── Microsoft
│ │ ├── MS-ASP-NET-WEB-OPTIMIZATION.LICENSE
│ │ ├── MS-DXSDK-D3DX-9.29.952.3.LICENSE
│ │ ├── MS-NET-LIBRARY-2019-06.LICENSE
│ │ └── PROPRIETARY-LICENSE.MS-WIN-SDK-W10.LICENSE
│ └── Nihui
│ │ └── WAIFU2X.LICENSE
└── README.localized
│ ├── README.fr-fr.md
│ ├── README.id-id.md
│ ├── README.ja-jp.md
│ ├── README.pt-pt.md
│ ├── README.ru-ru.md
│ └── README.zh-cn.md
├── Hi3Helper.CommunityToolkit
├── ImageCropper
│ ├── BitmapFileFormat.cs
│ ├── CropShape.cs
│ ├── Extension.cs
│ ├── Hi3Helper.CommunityToolkit.WinUI.Controls.ImageCropper.csproj
│ ├── ImageBlendBrush.cs
│ ├── ImageCropper.Animations.cs
│ ├── ImageCropper.Constants.cs
│ ├── ImageCropper.Events.cs
│ ├── ImageCropper.Helpers.cs
│ ├── ImageCropper.Logic.cs
│ ├── ImageCropper.Properties.cs
│ ├── ImageCropper.cs
│ ├── ImageCropper.xaml
│ ├── ImageCropperThumb.cs
│ ├── ImageCropperThumb.xaml
│ ├── ReadMe.md
│ ├── Themes
│ │ └── Generic.xaml
│ ├── ThumbPlacement.cs
│ ├── ThumbPosition.cs
│ └── packages.lock.json
├── SettingsControls
│ ├── Helpers
│ │ ├── ControlHelper.cs
│ │ ├── CornerRadiusConverter.cs
│ │ ├── ResourceDictionaryExtensions.cs
│ │ └── StyleExtensions.cs
│ ├── Hi3Helper.CommunityToolkit.WinUI.Controls.SettingsControls.csproj
│ ├── MultiTarget.props
│ ├── ReadMe.md
│ ├── SettingsCard
│ │ ├── SettingsCard.Properties.cs
│ │ ├── SettingsCard.cs
│ │ ├── SettingsCard.xaml
│ │ └── SettingsCardAutomationPeer.cs
│ ├── SettingsExpander
│ │ ├── SettingsExpander.Events.cs
│ │ ├── SettingsExpander.ItemsControl.cs
│ │ ├── SettingsExpander.Properties.cs
│ │ ├── SettingsExpander.cs
│ │ ├── SettingsExpander.xaml
│ │ ├── SettingsExpanderAutomationPeer.cs
│ │ └── SettingsExpanderItemStyleSelector.cs
│ ├── Themes
│ │ └── Generic.xaml
│ └── packages.lock.json
└── commitinfo.txt
├── Hi3Helper.Core
├── Classes
│ ├── Data
│ │ └── Tools
│ │ │ └── SteamTool.cs
│ ├── Logger
│ │ ├── Enum
│ │ │ └── LogType.cs
│ │ ├── ILog.cs
│ │ ├── ILoggerHelper.cs
│ │ ├── Logger.cs
│ │ ├── LoggerBase.cs
│ │ └── Type
│ │ │ ├── LoggerConsole.cs
│ │ │ └── LoggerNull.cs
│ ├── Preset
│ │ └── Classes
│ │ │ ├── ClassesContext.cs
│ │ │ └── XMFClasses.cs
│ ├── SentryHelper
│ │ ├── SentryEventProcessor.cs
│ │ ├── SentryExceptionFilter.cs
│ │ └── SentryHelper.cs
│ └── Shared
│ │ ├── ClassStruct
│ │ ├── Class
│ │ │ ├── CachesStructure.cs
│ │ │ └── GameDataStructure.cs
│ │ └── StructsEnums.cs
│ │ └── Region
│ │ └── LauncherConfig.cs
├── Data
│ ├── IniFile.cs
│ ├── IniSection.cs
│ └── IniValue.cs
├── Hi3Helper.Core.csproj
├── Lang
│ ├── Locale
│ │ ├── LangAppNotification.cs
│ │ ├── LangBackgroundNotification.cs
│ │ ├── LangCachesPage.cs
│ │ ├── LangCutscenesPage.cs
│ │ ├── LangDialogs.cs
│ │ ├── LangDisconnectedPage.cs
│ │ ├── LangFileCleanupPage.cs
│ │ ├── LangFileMigrationProcess.cs
│ │ ├── LangGameClientRegions.cs
│ │ ├── LangGameClientTitles.cs
│ │ ├── LangGameRepairPage.cs
│ │ ├── LangGameSettingsPage.cs
│ │ ├── LangGenshinGameSettingsPage.cs
│ │ ├── LangHomePage.cs
│ │ ├── LangInstallConvert.cs
│ │ ├── LangInstallManagement.cs
│ │ ├── LangInstallMigrateSteam.cs
│ │ ├── LangKeyboardShortcuts.cs
│ │ ├── LangMainPage.cs
│ │ ├── LangMisc.cs
│ │ ├── LangNotificationToast.cs
│ │ ├── LangOOBEAgreementMenu.cs
│ │ ├── LangOOBEStartUpMenu.cs
│ │ ├── LangSettingsPage.cs
│ │ ├── LangStarRailGameSettingsPage.cs
│ │ ├── LangStartupPage.cs
│ │ ├── LangUnhandledExceptionPage.cs
│ │ ├── LangUpdatePage.cs
│ │ └── LangZenlessGameSettingsPage.cs
│ ├── Localization.cs
│ ├── de_DE.json
│ ├── en_US.json
│ ├── es_419.json
│ ├── fr_FR.json
│ ├── id_ID.json
│ ├── ja_JP.json
│ ├── ko_KR.json
│ ├── pl_PL.json
│ ├── pt_BR.json
│ ├── pt_PT.json
│ ├── ru_RU.json
│ ├── th_TH.json
│ ├── uk_UA.json
│ ├── vi_VN.json
│ ├── zh_CN.json
│ └── zh_TW.json
└── packages.lock.json
├── Hi3Helper.EncTool.Test
├── Hi3Helper.EncTool.Test.csproj
├── Program.cs
├── Properties
│ └── launchSettings.json
└── packages.lock.json
├── Hi3Helper.TaskScheduler
├── FodyWeavers.xml
├── FodyWeavers.xsd
├── Hi3Helper.TaskScheduler.csproj
├── Program.cs
├── Properties
│ ├── PublishProfiles
│ │ └── AsRelease.pubxml
│ └── launchSettings.json
└── packages.lock.json
├── InnoSetupHelper
├── InnoSetupHelper.csproj
├── InnoSetupLogUpdate.cs
└── packages.lock.json
├── InstallerProp
├── DeployInstaller-Preview.iss
├── DeployInstaller-Stable.iss
├── DeployInstaller-preview-AppVeyor.iss
├── DeployInstaller-stable-AppVeyor.iss
├── WizardBannerDesign.bmp
├── WizardBannerDesign.png
├── WizardBannerDesignSmall.bmp
└── WizardBannerDesignSmall.png
├── LICENSE
├── PRIVACY.md
├── README.md
├── SECURITY.md
├── THIRD_PARTY_NOTICES.md
├── Type Dependencies Diagram for InstallationConvert and other elements.png
├── XamlStyler.bat
├── global.json
├── msi-installer-licensefile.rtf
├── qodana.yaml
├── settings.xamlstyler
└── transifex.yaml
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: neon-nyan
4 | custom: ['https://paypal.me/neonnyan']
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | # Main Goal
2 | {Describe/list your goal for the PR here}
3 |
4 | ## PR Status :
5 | - Overall Status : Done/In Progress/Stalled/Cancelled
6 | - Commits : Done/In Progress/Stalled/Cancelled
7 | - Synced to base (Collapse:main) : Yes/Not yet
8 | - Build status : OK/Crashing/Build Errors
9 | - Crashing : Yes/No
10 | - Bug found caused by PR : {int}
11 |
12 | ### Templates
13 |
14 |
15 | Changelog Prefixes
16 |
17 | ```
18 | **[New]**
19 | **[Imp]**
20 | **[Fix]**
21 | **[Loc]**
22 | **[Doc]**
23 | ```
24 |
25 |
26 |
--------------------------------------------------------------------------------
/.github/workflows/snyk-security.yml:
--------------------------------------------------------------------------------
1 | # This workflow uses actions that are not certified by GitHub.
2 | # They are provided by a third-party and are governed by
3 | # separate terms of service, privacy policy, and support
4 | # documentation.
5 |
6 | # A sample workflow which sets up Snyk to analyze the full Snyk platform (Snyk Open Source, Snyk Code,
7 | # Snyk Container and Snyk Infrastructure as Code)
8 | # The setup installs the Snyk CLI - for more details on the possible commands
9 | # check https://docs.snyk.io/snyk-cli/cli-reference
10 | # The results of Snyk Code are then uploaded to GitHub Security Code Scanning
11 | #
12 | # In order to use the Snyk Action you will need to have a Snyk API token.
13 | # More details in https://github.com/snyk/actions#getting-your-snyk-token
14 | # or you can signup for free at https://snyk.io/login
15 | #
16 | # For more examples, including how to limit scans to only high-severity issues
17 | # and fail PR checks, see https://github.com/snyk/actions/
18 |
19 | name: Snyk Security
20 |
21 | on:
22 | workflow_dispatch:
23 | push:
24 | branches: ["main"]
25 | pull_request:
26 | branches: ["main"]
27 |
28 | permissions:
29 | actions: read
30 | contents: read
31 | checks: write
32 | security-events: write
33 |
34 | jobs:
35 | snyk:
36 | runs-on: ubuntu-latest
37 | steps:
38 | - uses: actions/checkout@master
39 | with:
40 | submodules: recursive # many many submodules
41 |
42 | - name: Run Snyk to check for vulnerabilities
43 | uses: snyk/actions/dotnet@master
44 | continue-on-error: true # To make sure that SARIF upload gets called
45 | env:
46 | SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
47 | with:
48 | args: --all-projects --sarif-file-output=snyk.sarif --severity-threshold=high # fail on high severity
49 |
50 | - name: Upload result to GitHub Code Scanning
51 | uses: github/codeql-action/upload-sarif@v2
52 | with:
53 | sarif_file: snyk.sarif
54 |
--------------------------------------------------------------------------------
/.github/workflows/vt-scan-releases.yml:
--------------------------------------------------------------------------------
1 | name: VirusTotal Scan for Releases
2 |
3 | on:
4 | release:
5 | types: [published]
6 |
7 | jobs:
8 | virustotal:
9 | runs-on: ubuntu-latest
10 | permissions:
11 | actions: read
12 | contents: write
13 | pull-requests: write
14 | checks: write
15 | security-events: write
16 | deployments: write
17 | packages: write
18 | statuses: write
19 |
20 | steps:
21 | - name: VirusTotal Scan Executables
22 | uses: crazy-max/ghaction-virustotal@v4
23 | with:
24 | vt_api_key: ${{ secrets.VT_API_KEY }}
25 | update_release_body: true
26 | github_token: ${{ secrets.GITHUB_TOKEN }}
27 | files: |
28 | ^.*\.[eE][xX][eE]$
29 |
30 | - name: VirusTotal Scan Archive
31 | uses: crazy-max/ghaction-virustotal@v4
32 | with:
33 | vt_api_key: ${{ secrets.VT_API_KEY }}
34 | update_release_body: true
35 | github_token: ${{ secrets.GITHUB_TOKEN }}
36 | files: |
37 | ^.*\.[7][zZ]$
38 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "Hi3Helper.Http"]
2 | path = Hi3Helper.Http
3 | url = https://github.com/neon-nyan/Hi3Helper.Http
4 | [submodule "ColorThief"]
5 | path = ColorThief
6 | url = https://github.com/neon-nyan/ColorThief
7 | [submodule "Hi3Helper.EncTool"]
8 | path = Hi3Helper.EncTool
9 | url = https://github.com/CollapseLauncher/Hi3Helper.EncTool
10 | [submodule "InnoSetupHelper/InnoSetupLogParser"]
11 | path = InnoSetupHelper/InnoSetupLogParser
12 | url = https://github.com/CollapseLauncher/InnoSetupLogParser
13 | [submodule "Hi3Helper.SharpDiscordRPC"]
14 | path = Hi3Helper.SharpDiscordRPC
15 | url = https://github.com/CollapseLauncher/Hi3Helper.SharpDiscordRPC
16 | [submodule "Hi3Helper.Sophon"]
17 | path = Hi3Helper.Sophon
18 | url = https://github.com/CollapseLauncher/Hi3Helper.Sophon
19 | [submodule "ImageEx"]
20 | path = ImageEx
21 | url = https://github.com/CollapseLauncher/ImageEx
22 | [submodule "SevenZipExtractor"]
23 | path = SevenZipExtractor
24 | url = https://github.com/CollapseLauncher/SevenZipExtractor
25 | [submodule "H.NotifyIcon"]
26 | path = H.NotifyIcon
27 | url = https://github.com/CollapseLauncher/H.NotifyIcon
28 | [submodule "Hi3Helper.Win32"]
29 | path = Hi3Helper.Win32
30 | url = https://github.com/CollapseLauncher/Hi3Helper.Win32
31 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/.name:
--------------------------------------------------------------------------------
1 | CollapseLauncher
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/discord.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/indexLayout.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/projectSettingsUpdater.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/.idea.CollapseLauncher/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Backup/CommunityToolkit.WinUI.Controls.ImageCropper.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ImageCropper
6 | The ImageCropper control allows the user to freely crop an image.
7 |
8 |
9 | CommunityToolkit.WinUI.Controls.ImageCropperRns
10 | ReadMe.md
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | True
23 | \
24 |
25 |
26 |
27 |
28 | $(PackageIdPrefix).$(PackageIdVariant).Controls.$(ToolkitComponentName)
29 |
30 |
31 |
--------------------------------------------------------------------------------
/Backup/ReadMe.md:
--------------------------------------------------------------------------------
1 |
2 | # Windows Community Toolkit - ImageCropper
3 |
4 | This package is part of the [Windows Community Toolkit](https://aka.ms/toolkit/windows) from the [.NET Foundation](https://dotnetfoundation.org).
5 |
6 | ## Package Contents
7 |
8 | This package contains the following controls in the `CommunityToolkit.WinUI.Controls` namespace:
9 |
10 | - ImageCropper
11 |
12 | ## Which Package is for me?
13 |
14 | If you're developing with _UWP/WinUI 2 or Uno.UI_ you should be using the `CommunityToolkit.Uwp.Controls.ImageCropper` package.
15 |
16 | If you're developing with _WindowsAppSDK/WinUI 3 or Uno.WinUI_ you should be using the `CommunityToolkit.WinUI.Controls.ImageCropper` package.
17 |
18 | ## WinUI Resources (UWP)
19 |
20 | For UWP projects, the WinUI 2 reference requires you include the WinUI XAML Resources in your App.xaml file:
21 |
22 | ```xml
23 |
24 |
25 |
26 | ```
27 |
28 | See [Getting Started in WinUI 2](https://learn.microsoft.com/windows/apps/winui/winui2/getting-started) for more information.
29 |
30 | ## Documentation
31 |
32 | Further documentation about these components can be found at: https://aka.ms/windowstoolkitdocs
33 |
34 | ## License
35 |
36 | MIT
37 |
38 | See License.md in package for more details.
39 |
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/CollapseLauncherLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/CollapseLauncherLogo.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/CollapseLauncherLogoOutlineDark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/CollapseLauncherLogoOutlineDark.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/CollapseLauncherLogoOutlineLight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/CollapseLauncherLogoOutlineLight.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/CollapseLauncherLogoSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/CollapseLauncherLogoSmall.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Fonts/FontAwesomeBrand6.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Fonts/FontAwesomeBrand6.otf
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Fonts/FontAwesomeRegular6.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Fonts/FontAwesomeRegular6.otf
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Fonts/FontAwesomeSolid6.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Fonts/FontAwesomeSolid6.otf
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameBackground/genshin.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameBackground/genshin.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameBackground/honkai.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameBackground/honkai.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameBackground/starrail.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameBackground/starrail.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameBackground/zzz.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameBackground/zzz.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameIcon/icon-genshin.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameIcon/icon-genshin.ico
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameIcon/icon-honkai.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameIcon/icon-honkai.ico
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameIcon/icon-starrail.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameIcon/icon-starrail.ico
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameIcon/icon-zenless.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameIcon/icon-zenless.ico
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameLogo/genshin-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameLogo/genshin-logo.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameLogo/honkai-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameLogo/honkai-logo.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameLogo/starrail-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameLogo/starrail-logo.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameLogo/zenless-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameLogo/zenless-logo.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/AiHappy-MonoTransparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/AiHappy-MonoTransparent.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/AiShocked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/AiShocked.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/AponiaFly.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/AponiaFly.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/BangbooShocked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/BangbooShocked.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/BelleGasp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/BelleGasp.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/PaimonSleep-MonoTransparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/PaimonSleep-MonoTransparent.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/PaimonWhat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/PaimonWhat.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GameMascot/PomPomWhat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GameMascot/PomPomWhat.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/headerposter_genshin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/headerposter_genshin.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/headerposter_honkai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/headerposter_honkai.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/headerposter_starrail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/headerposter_starrail.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/headerposter_zzz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/headerposter_zzz.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/poster_genshin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/poster_genshin.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/poster_honkai.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/poster_honkai.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/poster_starrail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/poster_starrail.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GamePoster/poster_zzz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GamePoster/poster_zzz.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GenshinHDRCalibration/Scene.jxr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GenshinHDRCalibration/Scene.jxr
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GenshinHDRCalibration/Sign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GenshinHDRCalibration/Sign.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/GenshinHDRCalibration/UI.jxr:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/GenshinHDRCalibration/UI.jxr
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/ImageCropperOverlay/normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/ImageCropperOverlay/normal.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/ImageCropperOverlay/small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/ImageCropperOverlay/small.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/PageBackground/StartupBackground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/PageBackground/StartupBackground.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/PageBackground/StartupBackground2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/PageBackground/StartupBackground2.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/PageBackground/default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/PageBackground/default.png
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/PageBackground/default_genshin.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/PageBackground/default_genshin.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/PageBackground/default_honkai.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/PageBackground/default_honkai.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/PageBackground/default_starrail.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/PageBackground/default_starrail.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Images/PageBackground/default_zzz.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Images/PageBackground/default_zzz.webp
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Waifu2X_Models/scale2.0x_model.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Waifu2X_Models/scale2.0x_model.bin
--------------------------------------------------------------------------------
/CollapseLauncher/Assets/Waifu2X_Models/scale2.0x_model.param.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Assets/Waifu2X_Models/scale2.0x_model.param.bin
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/AnimatedVisuals/Lottie/DownloadIcon.lottie:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Classes/AnimatedVisuals/Lottie/DownloadIcon.lottie
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/AnimatedVisuals/Lottie/LoadingSprite.lottie:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Classes/AnimatedVisuals/Lottie/LoadingSprite.lottie
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/AnimatedVisuals/Lottie/StartGameIcon.lottie:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Classes/AnimatedVisuals/Lottie/StartGameIcon.lottie
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/AnimatedVisuals/Lottie/UpdateIcon.lottie:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Classes/AnimatedVisuals/Lottie/UpdateIcon.lottie
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/CachesManagement/Zenless/ZenlessCache.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.GameSettings.Zenless;
2 | using CollapseLauncher.Interfaces;
3 | using Microsoft.UI.Xaml;
4 | using System.Threading.Tasks;
5 | // ReSharper disable PartialTypeWithSinglePart
6 |
7 | namespace CollapseLauncher
8 | {
9 | internal partial class ZenlessCache(UIElement parentUI, IGameVersion gameVersionManager, ZenlessSettings gameSettings)
10 | : ZenlessRepair(parentUI, gameVersionManager, gameSettings, false, null, true), ICache, ICacheBase
11 | {
12 | public ZenlessCache AsBaseType() => this;
13 |
14 | public async Task StartUpdateRoutine(bool showInteractivePrompt = false)
15 | => await StartRepairRoutine(showInteractivePrompt);
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Extension/CancellationTokenExtensions.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 | // ReSharper disable PartialTypeWithSinglePart
4 |
5 | namespace CollapseLauncher.Extension
6 | {
7 | public sealed partial class CancellationTokenSourceWrapper : CancellationTokenSource
8 | {
9 | public bool IsDisposed;
10 | public bool IsCancelled;
11 |
12 | public new void Cancel()
13 | {
14 | if (!IsCancellationRequested) base.Cancel();
15 | IsCancelled = true;
16 | }
17 |
18 | public new async ValueTask CancelAsync()
19 | {
20 | await base.CancelAsync();
21 | IsCancelled = true;
22 | }
23 |
24 | protected override void Dispose(bool disposing)
25 | {
26 | IsDisposed = true;
27 | base.Dispose(disposing);
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Extension/FontFamilyExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml.Media;
2 |
3 | namespace CollapseLauncher.Extension
4 | {
5 | internal static class FontCollections
6 | {
7 | internal static FontFamily FontAwesomeSolid
8 | {
9 | get
10 | {
11 | if (field == null)
12 | field = UIElementExtensions.GetApplicationResource("FontAwesomeSolid");
13 |
14 | return field;
15 | }
16 | }
17 |
18 | internal static FontFamily FontAwesomeRegular
19 | {
20 | get
21 | {
22 | if (field == null)
23 | field = UIElementExtensions.GetApplicationResource("FontAwesome");
24 |
25 | return field;
26 | }
27 | }
28 |
29 | internal static FontFamily FontAwesomeBrand
30 | {
31 | get
32 | {
33 | if (field == null)
34 | field = UIElementExtensions.GetApplicationResource("FontAwesomeBrand");
35 |
36 | return field;
37 | }
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Extension/NumberExtensions.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.Shared.Region;
2 | using System;
3 | using System.Runtime.CompilerServices;
4 |
5 | namespace CollapseLauncher.Extension
6 | {
7 | internal static class NumberExtensions
8 | {
9 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
10 | internal static double ClampLimitedSpeedNumber(this double speed)
11 | => LauncherConfig.DownloadSpeedLimitCached > 0 ?
12 | Math.Min(LauncherConfig.DownloadSpeedLimitCached, speed) :
13 | speed;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Extension/TaskExtensions.TaskAwaitable.cs:
--------------------------------------------------------------------------------
1 | using System.Runtime.CompilerServices;
2 | using System.Threading;
3 | using System.Threading.Tasks;
4 | // ReSharper disable UnusedMember.Global
5 | // ReSharper disable CheckNamespace
6 |
7 | #nullable enable
8 | namespace CollapseLauncher.Extension
9 | {
10 | public delegate ConfiguredTaskAwaitable ActionTimeoutTaskAwaitableCallback(CancellationToken token);
11 |
12 | internal static partial class TaskExtensions
13 | {
14 | internal static async Task
15 | WaitForRetryAsync(this ActionTimeoutTaskAwaitableCallback funcCallback,
16 | int? timeout = null,
17 | int? timeoutStep = null,
18 | int? retryAttempt = null,
19 | ActionOnTimeOutRetry? actionOnRetry = null,
20 | CancellationToken fromToken = default)
21 | => await funcCallback.Invoke(fromToken);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Extension/UIElementExtensions.UnsafeAccessorExtensions.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Input;
2 | using Microsoft.UI.Xaml;
3 | using System.Runtime.CompilerServices;
4 |
5 | #nullable enable
6 | namespace CollapseLauncher.Extension
7 | {
8 | internal static partial class UIElementExtensions
9 | {
10 | ///
11 | /// Set the cursor for the element.
12 | ///
13 | /// The member of an element
14 | /// The cursor you want to set. Use to choose the cursor you want to set.
15 | [UnsafeAccessor(UnsafeAccessorKind.Method, Name = "set_ProtectedCursor")]
16 | internal static extern void SetCursor(this UIElement element, InputCursor inputCursor);
17 |
18 | ///
19 | /// Set the cursor for the element.
20 | ///
21 | /// The member of an element
22 | /// The cursor you want to set. Use to choose the cursor you want to set.
23 | internal static T WithCursor(this T element, InputCursor inputCursor) where T : UIElement
24 | {
25 | element.SetCursor(inputCursor);
26 | return element;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/FileMigrationProcess/FileMigrationProcessRef.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.CustomControls;
2 | using Microsoft.UI.Xaml.Controls;
3 | using Microsoft.UI.Xaml.Documents;
4 |
5 | namespace CollapseLauncher
6 | {
7 | internal class FileMigrationProcessUIRef
8 | {
9 | internal ContentDialogCollapse MainDialogWindow { get; set; }
10 | internal TextBlock PathActivitySubtitle { get; set; }
11 | internal Run SpeedIndicatorSubtitle { get; set; }
12 | internal Run FileCountIndicatorSubtitle { get; set; }
13 | internal Run FileSizeIndicatorSubtitle { get; set; }
14 | internal ProgressBar ProgressBarIndicator { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GamePlaytime/Context.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | // ReSharper disable PartialTypeWithSinglePart
3 |
4 | namespace CollapseLauncher.GamePlaytime
5 | {
6 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
7 | [JsonSerializable(typeof(CollapsePlaytime))]
8 | internal sealed partial class UniversalPlaytimeJsonContext : JsonSerializerContext;
9 | }
10 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GameSettings/BaseClass/ScreenSettingData.cs:
--------------------------------------------------------------------------------
1 | using System.Drawing;
2 | // ReSharper disable InconsistentNaming
3 | // ReSharper disable IdentifierTypo
4 |
5 | namespace CollapseLauncher.GameSettings.Base
6 | {
7 | internal class BaseScreenSettingData
8 | {
9 | public virtual Size sizeRes { get; set; }
10 | public virtual string sizeResString { get; set; }
11 | public virtual int width { get; set; }
12 | public virtual int height { get; set; }
13 | public virtual bool isfullScreen { get; set; }
14 | public virtual void Save() { }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GameSettings/Genshin/Context.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | // ReSharper disable PartialTypeWithSinglePart
3 | // ReSharper disable IdentifierTypo
4 |
5 | namespace CollapseLauncher.GameSettings.Genshin.Context
6 | {
7 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
8 | [JsonSerializable(typeof(GeneralData))]
9 | [JsonSerializable(typeof(GraphicsData))]
10 | [JsonSerializable(typeof(GlobalPerfData))]
11 | internal sealed partial class GenshinSettingsJsonContext : JsonSerializerContext;
12 | }
13 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GameSettings/Genshin/Settings.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.GameSettings.Base;
2 | using CollapseLauncher.Interfaces;
3 | // ReSharper disable IdentifierTypo
4 |
5 | namespace CollapseLauncher.GameSettings.Genshin
6 | {
7 | internal class GenshinSettings : SettingsBase
8 | {
9 | public GeneralData SettingsGeneralData { get; set; }
10 | public VisibleBackground SettingVisibleBackground { get; set; }
11 | public WindowsHDR SettingsWindowsHDR { get; set; }
12 |
13 | public GenshinSettings(IGameVersion gameVersionManager)
14 | : base(gameVersionManager)
15 | {
16 | // Initialize and Load Settings
17 | InitializeSettings();
18 | }
19 |
20 | public sealed override void InitializeSettings()
21 | {
22 | // Load Settings
23 | base.InitializeSettings();
24 | SettingsScreen = ScreenManager.Load();
25 | SettingVisibleBackground = VisibleBackground.Load();
26 | SettingsWindowsHDR = WindowsHDR.Load();
27 | }
28 |
29 | public override void ReloadSettings()
30 | {
31 | // To ease up resource and prevent bad JSON locking up launcher
32 | SettingsGeneralData = GeneralData.Load();
33 | InitializeSettings();
34 | }
35 |
36 | #nullable enable
37 | public override void SaveSettings()
38 | {
39 | // Save Settings
40 | base.SaveSettings();
41 | SettingsScreen?.Save();
42 | SettingsGeneralData?.Save();
43 | SettingVisibleBackground?.Save();
44 | SettingsWindowsHDR?.Save();
45 | }
46 |
47 | public override IGameSettingsUniversal AsIGameSettingsUniversal() => this;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GameSettings/Honkai/Context.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Text.Json.Serialization;
3 | // ReSharper disable PartialTypeWithSinglePart
4 | // ReSharper disable CheckNamespace
5 |
6 | namespace CollapseLauncher.GameSettings.Honkai.Context
7 | {
8 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
9 | [JsonSerializable(typeof(ScreenSettingData))]
10 | [JsonSerializable(typeof(PersonalAudioSetting))]
11 | [JsonSerializable(typeof(PersonalGraphicsSettingV2))]
12 | [JsonSerializable(typeof(PersonalAudioSettingVolume))]
13 | [JsonSerializable(typeof(Dictionary))]
14 | internal sealed partial class HonkaiSettingsJsonContext : JsonSerializerContext;
15 | }
16 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GameSettings/StarRail/Context.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | // ReSharper disable PartialTypeWithSinglePart
3 |
4 | namespace CollapseLauncher.GameSettings.StarRail.Context
5 | //Modified from Honkai codes because of similarities in reg structure
6 | {
7 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
8 | [JsonSerializable(typeof(Model))]
9 | [JsonSerializable(typeof(PCResolution))]
10 | internal sealed partial class StarRailSettingsJsonContext : JsonSerializerContext;
11 | }
12 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GameSettings/Universal/Context.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | // ReSharper disable PartialTypeWithSinglePart
3 |
4 | namespace CollapseLauncher.GameSettings.Universal
5 | {
6 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
7 | [JsonSerializable(typeof(CollapseScreenSetting))]
8 | [JsonSerializable(typeof(CollapseMiscSetting))]
9 | internal sealed partial class UniversalSettingsJsonContext : JsonSerializerContext;
10 | }
11 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/GameSettings/Zenless/Context.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | // ReSharper disable PartialTypeWithSinglePart
3 |
4 | namespace CollapseLauncher.GameSettings.Zenless.Context;
5 |
6 | [JsonSourceGenerationOptions(IncludeFields = false,
7 | GenerationMode = JsonSourceGenerationMode.Metadata,
8 | IgnoreReadOnlyFields = true,
9 | UnknownTypeHandling = JsonUnknownTypeHandling.JsonNode)]
10 | [JsonSerializable(typeof(GeneralData))]
11 | internal sealed partial class ZenlessSettingsJsonContext : JsonSerializerContext;
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/Versioning/Extension.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.Interfaces;
2 |
3 | namespace CollapseLauncher.GameManagement.Versioning
4 | {
5 | internal static class GameVersionExtension
6 | {
7 | ///
8 | /// Casting the IGameVersion as its origin or another version class.
9 | ///
10 | /// The type of version class to cast
11 | /// The version class to get cast
12 | internal static TCast CastAs(this IGameVersion versionCheck)
13 | where TCast : GameVersionBase, IGameVersion => (TCast)versionCheck;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/Versioning/GameVersionBase.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.Interfaces;
2 | // ReSharper disable IdentifierTypo
3 | // ReSharper disable InconsistentNaming
4 | // ReSharper disable StringLiteralTypo
5 | // ReSharper disable CheckNamespace
6 |
7 | #nullable enable
8 | namespace CollapseLauncher.GameManagement.Versioning
9 | {
10 | internal partial class GameVersionBase : IGameVersion
11 | {
12 | protected GameVersionBase(RegionResourceProp gameRegionProp, string gameName, string gameRegion)
13 | {
14 | GameApiProp = gameRegionProp;
15 | GameName = gameName;
16 | GameRegion = gameRegion;
17 |
18 | // Initialize INI Prop ahead of other operations
19 | // ReSharper disable once VirtualMemberCallInConstructor
20 | InitializeIniProp();
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GameManagement/Versioning/Honkai/VersionCheck.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.GameManagement.Versioning;
2 | using System;
3 | // ReSharper disable IdentifierTypo
4 | // ReSharper disable UnusedMember.Global
5 |
6 | namespace CollapseLauncher.GameVersioning
7 | {
8 | internal sealed class GameTypeHonkaiVersion(
9 | RegionResourceProp gameRegionProp,
10 | string gameName,
11 | string gameRegion)
12 | : GameVersionBase(gameRegionProp, gameName, gameRegion)
13 | {
14 | #region Statics
15 | private static readonly Version SenadinaVersion = new(7, 3, 0);
16 | #endregion
17 |
18 | #region Public properties
19 | public bool IsCurrentSenadinaVersion { get => GameVersionAPI?.ToVersion() >= SenadinaVersion; }
20 | public bool IsPreloadSenadinaVersion { get => GameVersionAPIPreload.HasValue && GameVersionAPIPreload.Value.ToVersion() >= SenadinaVersion; }
21 | #endregion
22 |
23 | public override bool IsGameHasDeltaPatch() => GameDeltaPatchProp != null;
24 |
25 | public override DeltaPatchProperty GetDeltaPatchInfo() => GameDeltaPatchProp;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/GenericJSONContext.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.EncTool.Parser.AssetMetadata;
2 | using System.Collections.Generic;
3 | using System.Text.Json.Serialization;
4 | // ReSharper disable PartialTypeWithSinglePart
5 |
6 | #nullable enable
7 | namespace CollapseLauncher
8 | {
9 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
10 | [JsonSerializable(typeof(int[]))]
11 | [JsonSerializable(typeof(AudioPCKType[]))]
12 | [JsonSerializable(typeof(Dictionary>))]
13 | internal sealed partial class GenericJsonContext : JsonSerializerContext;
14 | }
15 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Background/Loaders/IBackgroundMediaLoader.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics.CodeAnalysis;
3 | using System.Threading;
4 | using System.Threading.Tasks;
5 | // ReSharper disable UnusedMemberInSuper.Global
6 |
7 | #nullable enable
8 | namespace CollapseLauncher.Helper.Background.Loaders
9 | {
10 | [SuppressMessage("ReSharper", "IdentifierTypo")]
11 | [SuppressMessage("ReSharper", "PossibleNullReferenceException")]
12 | [SuppressMessage("ReSharper", "AssignNullToNotNullAttribute")]
13 | internal interface IBackgroundMediaLoader : IDisposable
14 | {
15 | bool IsBackgroundDimm { get; set; }
16 |
17 | Task LoadAsync(string filePath, bool isForceRecreateCache = false, bool isRequestInit = false, CancellationToken token = default);
18 | void Dimm();
19 | void Undimm();
20 | void Show(bool isForceShow = false);
21 | void Hide();
22 | void Mute();
23 | void Unmute();
24 | void SetVolume(double value);
25 | void WindowFocused();
26 | void WindowUnfocused();
27 | void Play();
28 | void Pause();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/JsonConverter/EmptyStringAsNullConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.Json;
3 | using System.Text.Json.Serialization;
4 |
5 | #nullable enable
6 | namespace CollapseLauncher.Helper.JsonConverter
7 | {
8 | internal class EmptyStringAsNullConverter : JsonConverter
9 | {
10 | public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
11 | {
12 | if (reader.TokenType != JsonTokenType.String)
13 | throw new JsonException("Current type token is not a string!");
14 |
15 | return reader.ValueSpan.Length == 0 ? null : Extension.ReturnUnescapedData(reader.ValueSpan);
16 | }
17 |
18 | public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
19 | {
20 | throw new NotImplementedException();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/JsonConverter/NormalizedPathStringConverter.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.Data;
2 | using System;
3 | using System.Buffers;
4 | using System.Text;
5 | using System.Text.Json;
6 | using System.Text.Json.Serialization;
7 |
8 | #nullable enable
9 | namespace CollapseLauncher.Helper.JsonConverter
10 | {
11 | internal class NormalizedPathStringConverter : JsonConverter
12 | {
13 | public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
14 | {
15 | if (reader.TokenType != JsonTokenType.String)
16 | throw new JsonException("Current type token is not a string!");
17 |
18 | int spanLen = reader.ValueSpan.Length;
19 | if (spanLen == 0)
20 | {
21 | return null;
22 | }
23 |
24 | char[] buffer = ArrayPool.Shared.Rent(spanLen);
25 | try
26 | {
27 | Encoding.UTF8.TryGetChars(reader.ValueSpan, buffer, out int charsWritten);
28 | ConverterTool.NormalizePathInplaceNoTrim(buffer.AsSpan(0, charsWritten));
29 | return new string(buffer, 0, charsWritten);
30 | }
31 | finally
32 | {
33 | ArrayPool.Shared.Return(buffer);
34 | }
35 | }
36 |
37 | public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
38 | {
39 | throw new NotImplementedException();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/JsonConverter/RegionResourcePluginValidateConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Text.Json;
5 | using System.Text.Json.Serialization;
6 |
7 | namespace CollapseLauncher.Helper.JsonConverter
8 | {
9 | public class RegionResourcePluginValidateConverter : JsonConverter>
10 | {
11 | public override bool CanConvert(Type type)
12 | {
13 | return true;
14 | }
15 |
16 | public override List Read(
17 | ref Utf8JsonReader reader,
18 | Type typeToConvert,
19 | JsonSerializerOptions options)
20 | {
21 | string valueString = EmptiedBackslash(reader.ValueSpan);
22 | List returnList = valueString.Deserialize(RegionResourcePluginValidateJsonContext.Default.ListRegionResourcePluginValidate);
23 |
24 | return returnList;
25 | }
26 |
27 | private static unsafe string EmptiedBackslash(ReadOnlySpan span)
28 | {
29 | Span buffer = new byte[span.Length];
30 | int indexIn = 0;
31 | int indexOut = 0;
32 | while (indexIn < span.Length)
33 | {
34 | if (span[indexIn] == '\\')
35 | {
36 | ++indexIn;
37 | continue;
38 | }
39 |
40 | buffer[indexOut] = span[indexIn];
41 | ++indexIn;
42 | ++indexOut;
43 | }
44 |
45 | fixed (byte* bufferPtr = buffer)
46 | {
47 | return Encoding.UTF8.GetString(bufferPtr, indexOut);
48 | }
49 | }
50 |
51 | public override void Write(
52 | Utf8JsonWriter writer,
53 | List baseType,
54 | JsonSerializerOptions options)
55 | {
56 |
57 | throw new JsonException("Serializing is not supported!");
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/JsonConverter/SanitizeUrlStringConverter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text.Json;
3 | using System.Text.Json.Serialization;
4 |
5 | #nullable enable
6 | namespace CollapseLauncher.Helper.JsonConverter
7 | {
8 | internal class SanitizeUrlStringConverter : JsonConverter
9 | {
10 | public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
11 | {
12 | if (reader.TokenType != JsonTokenType.String)
13 | throw new JsonException("Current type token is not a string!");
14 |
15 | if (reader.ValueSpan.Length == 0) return null;
16 |
17 | string unescapedString = Extension.ReturnUnescapedData(reader.ValueSpan);
18 | string stripped = Extension.StripTabsAndNewlinesUtf8(unescapedString);
19 | return stripped;
20 | }
21 |
22 | public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
23 | {
24 | throw new NotImplementedException();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/JsonConverter/SlashToBackslashConverter.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.Data;
2 | using System;
3 | using System.Text.Json;
4 | using System.Text.Json.Serialization;
5 |
6 | #nullable enable
7 | namespace CollapseLauncher.Helper.JsonConverter
8 | {
9 | internal class SlashToBackslashConverter : JsonConverter
10 | {
11 | public override string? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
12 | {
13 | if (reader.TokenType != JsonTokenType.String)
14 | throw new JsonException("Current type token is not a string!");
15 |
16 | string? str = reader.GetString();
17 | return ConverterTool.NormalizePath(str);
18 | }
19 |
20 | public override void Write(Utf8JsonWriter writer, string value, JsonSerializerOptions options)
21 | {
22 | string replaced = value.Replace('\\', '/');
23 | writer.WriteStringValue(replaced);
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/LauncherApiLoader/ILauncherApi.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.Extension;
2 | using CollapseLauncher.Helper.LauncherApiLoader.HoYoPlay;
3 | using CollapseLauncher.Helper.LauncherApiLoader.Legacy;
4 | using System;
5 | using System.Net.Http;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 | // ReSharper disable UnusedMemberInSuper.Global
9 | // ReSharper disable IdentifierTypo
10 |
11 | #nullable enable
12 | namespace CollapseLauncher.Helper.LauncherApiLoader
13 | {
14 | public interface ILauncherApi : IDisposable
15 | {
16 | bool IsLoadingCompleted { get; }
17 | bool IsForceRedirectToSophon { get; }
18 | string? GameBackgroundImg { get; }
19 | string? GameBackgroundImgLocal { get; set; }
20 | string? GameName { get; }
21 | string? GameRegion { get; }
22 | string? GameNameTranslation { get; }
23 | string? GameRegionTranslation { get; }
24 | HoYoPlayGameInfoField? LauncherGameInfoField { get; }
25 | RegionResourceProp? LauncherGameResource { get; }
26 | LauncherGameNews? LauncherGameNews { get; }
27 | HttpClient? ApiGeneralHttpClient { get; }
28 | HttpClient? ApiResourceHttpClient { get; }
29 | Task LoadAsync(OnLoadTaskAction? beforeLoadRoutine = null, OnLoadTaskAction? afterLoadRoutine = null,
30 | ActionOnTimeOutRetry? onTimeoutRoutine = null, ErrorLoadRoutineDelegate? errorLoadRoutine = null,
31 | CancellationToken token = default);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/LauncherApiLoader/Legacy/LegacyLauncherApiLoader.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.Helper.Metadata;
2 | // ReSharper disable IdentifierTypo
3 | // ReSharper disable PartialTypeWithSinglePart
4 |
5 | #nullable enable
6 | namespace CollapseLauncher.Helper.LauncherApiLoader.Legacy
7 | {
8 | internal sealed partial class LegacyLauncherApiLoader : LauncherApiBase
9 | {
10 | private LegacyLauncherApiLoader(PresetConfig presetConfig, string gameName, string gameRegion)
11 | : base(presetConfig, gameName, gameRegion) { }
12 |
13 | public static LegacyLauncherApiLoader CreateApiInstance(PresetConfig presetConfig, string gameName, string gameRegion)
14 | => new(presetConfig, gameName, gameRegion);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/BHI3LInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | // ReSharper disable InconsistentNaming
3 | // ReSharper disable PartialTypeWithSinglePart
4 |
5 | namespace CollapseLauncher.Helper.Metadata
6 | {
7 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
8 | [JsonSerializable(typeof(BHI3LInfo))]
9 | internal sealed partial class BHI3LInfoJsonContext : JsonSerializerContext;
10 |
11 | internal sealed class BHI3LInfo
12 | {
13 | public BHI3LInfo_GameInfo game_info { get; set; }
14 | }
15 |
16 | internal sealed class BHI3LInfo_GameInfo
17 | {
18 | public string version { get; set; }
19 | public string install_path { get; set; }
20 | public bool installed { get; set; }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/GameDataTemplate.cs:
--------------------------------------------------------------------------------
1 | #nullable enable
2 | using System.Collections.Generic;
3 |
4 | namespace CollapseLauncher.Helper.Metadata
5 | {
6 | public class GameDataTemplate
7 | {
8 | public Dictionary? DataVersion { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/GameDataVersion.cs:
--------------------------------------------------------------------------------
1 | #nullable enable
2 | using System;
3 | // ReSharper disable UnusedMember.Global
4 |
5 | namespace CollapseLauncher.Helper.Metadata
6 | {
7 | public class GameDataVersion
8 | {
9 | public byte[]? Data
10 | {
11 | get;
12 | init
13 | {
14 | if (DataCooker.IsServeV3Data(value))
15 | {
16 | DataCooker.GetServeV3DataSize(value, out long compressedSize, out long decompressedSize);
17 | byte[] dataOut = new byte[decompressedSize];
18 | DataCooker.ServeV3Data(value, dataOut, (int)compressedSize, (int)decompressedSize, out _);
19 | field = dataOut;
20 | }
21 |
22 | field = value;
23 | }
24 | }
25 |
26 | public long Length { get; set; }
27 | public bool IsCompressed { get; set; }
28 |
29 | public static int GetBytesToIntVersion(byte[] version)
30 | {
31 | if (version.Length != 4) throw new FormatException("Argument: version must have 4 bytes");
32 | return version[0] | version[1] << 8 | version[2] << 16 | version[3] << 24;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/Hashable.cs:
--------------------------------------------------------------------------------
1 | namespace CollapseLauncher.Helper.Metadata
2 | {
3 | public class Hashable
4 | {
5 | public long Hash { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/MasterKeyConfig.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 | // ReSharper disable PartialTypeWithSinglePart
3 |
4 | namespace CollapseLauncher.Helper.Metadata
5 | {
6 | #nullable enable
7 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
8 | [JsonSerializable(typeof(MasterKeyConfig))]
9 | internal sealed partial class MesterKeyConfigJsonContext : JsonSerializerContext;
10 |
11 | public sealed class MasterKeyConfig : Hashable
12 | {
13 | public byte[]? Key { get; set; }
14 | public int BitSize { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/MetadataType.cs:
--------------------------------------------------------------------------------
1 | using System.Text.Json.Serialization;
2 |
3 | namespace CollapseLauncher.Helper.Metadata
4 | {
5 | [JsonConverter(typeof(JsonStringEnumConverter))]
6 | public enum MetadataType
7 | {
8 | Unknown,
9 | PresetConfigV2,
10 | MasterKey,
11 | CommunityTools
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/Stamp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text.Json.Serialization;
4 | // ReSharper disable PartialTypeWithSinglePart
5 | // ReSharper disable UnusedMember.Global
6 |
7 | #nullable enable
8 | namespace CollapseLauncher.Helper.Metadata
9 | {
10 | [JsonSourceGenerationOptions(IncludeFields = false, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
11 | [JsonSerializable(typeof(List))]
12 | internal sealed partial class StampJsonContext : JsonSerializerContext;
13 |
14 | public sealed class Stamp
15 | {
16 | public long LastUpdated { get; set; }
17 | public string? MetadataPath { get; set; } = null;
18 | public MetadataType? MetadataType { get; set; } = null;
19 | public bool? MetadataInclude { get; set; } = null;
20 | public string? GameName { get; set; } = null;
21 | public string? GameRegion { get; set; } = null;
22 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
23 | public DateTime LastModifiedTimeUtc { get; set; } = default;
24 | public string? PresetConfigVersion { get; set; }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/Metadata/SteamGameProp.cs:
--------------------------------------------------------------------------------
1 | #nullable enable
2 | namespace CollapseLauncher.Helper.Metadata
3 | {
4 | public class SteamGameProp
5 | {
6 | public string? URL { get; set; }
7 | public string? MD5 { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Helper/PatternMatcher.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Linq;
3 | using System.Text.RegularExpressions;
4 |
5 | namespace CollapseLauncher.Helper
6 | {
7 | public static class PatternMatcher
8 | {
9 | ///
10 | /// Determines whether the specified input string matches the given pattern.
11 | /// The pattern can contain wildcards ('*').
12 | ///
13 | /// The input string to match.
14 | /// The pattern to match against, which can contain wildcards ('*').
15 | /// True if the input matches the pattern; otherwise, false.
16 | public static bool MatchSimpleExpression(string input, string pattern)
17 | {
18 | // Escape special regex characters in the pattern except for the wildcard '*'
19 | var regexPattern = "^" + Regex.Escape(pattern).Replace("\\*", ".*") + "$";
20 | return Regex.IsMatch(input, regexPattern,
21 | RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.NonBacktracking);
22 | }
23 |
24 | ///
25 | /// Determines whether the specified input string matches any pattern in the given list of patterns.
26 | ///
27 | /// The input string to match.
28 | /// A list of patterns to match against, each of which can contain wildcards ('*').
29 | /// True if the input matches any pattern in the list; otherwise, false.
30 | public static bool MatchesAnyPattern(string input, List patterns)
31 | {
32 | return patterns.Any(pattern => MatchSimpleExpression(input, pattern));
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/Class/DeltaPatchProperty.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | // ReSharper disable MemberInitializerValueIgnored
4 | // ReSharper disable UnusedAutoPropertyAccessor.Global
5 | // ReSharper disable InconsistentNaming
6 | // ReSharper disable CheckNamespace
7 | // ReSharper disable IdentifierTypo
8 |
9 | namespace CollapseLauncher
10 | {
11 | internal class DeltaPatchProperty
12 | {
13 | internal DeltaPatchProperty(string patchFile)
14 | {
15 | ReadOnlySpan strings = Path.GetFileNameWithoutExtension(patchFile).Split('_');
16 | MD5hash = strings[5];
17 | ZipHash = strings[4];
18 | ProfileName = strings[0];
19 | SourceVer = strings[1];
20 | TargetVer = strings[2];
21 | PatchCompr = strings[3];
22 | PatchPath = patchFile;
23 | }
24 |
25 | public string ZipHash { get; set; }
26 | public string MD5hash { get; set; }
27 | public string ProfileName { get; set; }
28 | public string SourceVer { get; set; }
29 | public string TargetVer { get; set; }
30 | public string PatchCompr { get; set; }
31 | public string PatchPath { get; set; }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/Class/Enums.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable InconsistentNaming
2 | // ReSharper disable UnusedMember.Global
3 | namespace CollapseLauncher
4 | {
5 | internal enum RepairAssetType
6 | {
7 | Generic,
8 | Block,
9 | BlockUpdate,
10 | Audio,
11 | AudioUpdate,
12 | Video,
13 | Chunk,
14 |
15 | Unused
16 | }
17 |
18 | internal enum CacheAssetType
19 | {
20 | Data,
21 | Event,
22 | AI,
23 | Unused,
24 | Dispatcher,
25 | Gateway,
26 |
27 | General, // Additional for HSR
28 | IFix, // Additional for HSR
29 | DesignData, // Additional for HSR
30 | Lua // Additional for HSR
31 | }
32 |
33 | internal enum CacheAssetStatus
34 | {
35 | New,
36 | Obsolete,
37 | Unused
38 | }
39 |
40 | internal enum GameInstallPackageType
41 | {
42 | General,
43 | Audio,
44 | Plugin,
45 | Utilities
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IAssetEntry.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.ObjectModel;
2 |
3 | namespace CollapseLauncher.Interfaces
4 | {
5 | internal interface IAssetEntry
6 | {
7 | ObservableCollection AssetEntry { get; set; }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IBackgroundActivity.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Dispatching;
2 | using Microsoft.UI.Xaml;
3 | using System;
4 | using System.Threading.Tasks;
5 |
6 | namespace CollapseLauncher.Interfaces
7 | {
8 | internal interface IBackgroundActivity
9 | {
10 | event EventHandler ProgressChanged;
11 | event EventHandler StatusChanged;
12 | event EventHandler FlushingTrigger;
13 |
14 | bool IsRunning { get; }
15 | UIElement ParentUI { get; }
16 | void CancelRoutine();
17 | void Dispatch(DispatcherQueueHandler handler, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal);
18 | Task DispatchAsync(Action handler, DispatcherQueuePriority priority = DispatcherQueuePriority.Normal);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/ICache.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using System.Threading.Tasks;
4 |
5 | namespace CollapseLauncher.Interfaces
6 | {
7 | internal interface ICache : IDisposable
8 | {
9 | ObservableCollection AssetEntry { get; set; }
10 | event EventHandler ProgressChanged;
11 | event EventHandler StatusChanged;
12 | Task StartCheckRoutine(bool useFastCheck = false);
13 | Task StartUpdateRoutine(bool showInteractivePrompt = false);
14 | void CancelRoutine();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/ICacheBaseT.cs:
--------------------------------------------------------------------------------
1 | namespace CollapseLauncher.Interfaces
2 | {
3 | internal interface ICacheBase
4 | {
5 | T AsBaseType();
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IGameInstallManager.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.InstallManager;
2 | using CollapseLauncher.InstallManager.Base;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 | // ReSharper disable UnusedMemberInSuper.Global
8 | // ReSharper disable IdentifierTypo
9 |
10 | namespace CollapseLauncher.Interfaces
11 | {
12 | internal interface IGameInstallManager : IBackgroundActivity, IDisposable
13 | {
14 | ValueTask GetInstallationPath(bool isHasOnlyMigrateOption = false);
15 | Task StartPackageDownload(bool skipDialog = false);
16 | ValueTask StartPackageVerification(List gamePackage = null);
17 | Task StartPackageInstallation();
18 | void ApplyGameConfig(bool forceUpdateToLatest = false);
19 |
20 | ValueTask MoveGameLocation();
21 | ValueTask UninstallGame();
22 | void Flush();
23 | ValueTask IsPreloadCompleted(CancellationToken token = default);
24 |
25 | ValueTask TryShowFailedDeltaPatchState();
26 | ValueTask TryShowFailedGameConversionState();
27 | ValueTask CleanUpGameFiles(bool withDialog = true);
28 |
29 | void UpdateCompletenessStatus(CompletenessStatus status);
30 |
31 | bool StartAfterInstall { get; set; }
32 | bool IsUseSophon { get; }
33 | bool IsSophonInUpdateMode { get; }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IGamePlaytime.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.GamePlaytime;
2 | using System;
3 | using System.Diagnostics;
4 | using System.Threading.Tasks;
5 |
6 | namespace CollapseLauncher.Interfaces
7 | {
8 | internal interface IGamePlaytime : IDisposable
9 | {
10 | event EventHandler PlaytimeUpdated;
11 | CollapsePlaytime CollapsePlaytime { get; }
12 |
13 | void Reset();
14 | void Update(TimeSpan timeSpan, bool forceUpdateDb = false);
15 | void StartSession(Process proc, DateTime? begin = null);
16 | Task CheckDb(bool redirectThrow = false);
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IGameSettings.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | // ReSharper disable UnusedMemberInSuper.Global
4 |
5 | #nullable enable
6 | namespace CollapseLauncher.Interfaces
7 | {
8 | internal interface IGameSettings : IGameSettingsUniversal
9 | {
10 | Task ImportSettings(string? gameBasePath = null);
11 | Task ExportSettings(bool isCompressed = true, string? parentPathToImport = null, string[]? relativePathToImport = null);
12 | void InitializeSettings();
13 | void ReloadSettings();
14 | void SaveSettings();
15 | IGameSettingsUniversal AsIGameSettingsUniversal();
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IGameSettingsUniversal.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.GameSettings.Base;
2 | using CollapseLauncher.GameSettings.Universal;
3 |
4 | namespace CollapseLauncher.Interfaces
5 | {
6 | internal interface IGameSettingsUniversal
7 | {
8 | BaseScreenSettingData SettingsScreen { get; set; }
9 | CollapseScreenSetting SettingsCollapseScreen { get; set; }
10 | CollapseMiscSetting SettingsCollapseMisc { get; set; }
11 | CustomArgs SettingsCustomArgument { get; set; }
12 | void SaveBaseSettings();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IGameSettingsValue.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.GameSettings.Base;
2 | using System.Diagnostics;
3 | using System.Text.Json.Serialization.Metadata;
4 | // ReSharper disable UnusedMemberInSuper.Global
5 |
6 | namespace CollapseLauncher.Interfaces
7 | {
8 | internal interface IGameSettingsValue
9 | {
10 | static abstract T Load();
11 | void Save();
12 | }
13 |
14 | internal interface IGameSettingsValueMagic : IGameSettingsValue
15 | {
16 | [DebuggerBrowsable(DebuggerBrowsableState.Never)]
17 | byte[] Magic { get; }
18 |
19 | #nullable enable
20 | static abstract T LoadWithMagic(byte[] magic, SettingsGameVersionManager versionManager, JsonTypeInfo typeInfo);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IRepair.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.ObjectModel;
3 | using System.Threading.Tasks;
4 |
5 | namespace CollapseLauncher.Interfaces
6 | {
7 | internal interface IRepair : IDisposable
8 | {
9 | ObservableCollection AssetEntry { get; set; }
10 | event EventHandler ProgressChanged;
11 | event EventHandler StatusChanged;
12 | Task StartCheckRoutine(bool useFastCheck = false);
13 | Task StartRepairRoutine(bool showInteractivePrompt = false, Action actionIfInteractiveCancel = null);
14 | void CancelRoutine();
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/Interfaces/IRepairAssetIndex.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.Shared.ClassStruct;
2 | using System;
3 | using System.Collections.Generic;
4 |
5 | namespace CollapseLauncher.Interfaces
6 | {
7 | internal interface IRepairAssetIndex : IDisposable
8 | {
9 | List GetAssetIndex();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/CollapseLauncher/Classes/RepairManagement/Zenless/ZenlessResManifest.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.EncTool.Parser.Sleepy.JsonConverters;
2 | using System.Text.Json.Serialization;
3 | // ReSharper disable CommentTypo
4 | // ReSharper disable UnusedMember.Global
5 |
6 | namespace CollapseLauncher
7 | {
8 | internal class ZenlessResManifestAsset
9 | {
10 | [JsonPropertyName("remoteName")]
11 | public string FileRelativePath { get; set; }
12 |
13 | [JsonPropertyName("md5")] // "mD5" they said. BROO, IT'S A F**KING XXH64 HASH!!!!
14 | [JsonConverter(typeof(NumberStringToXxh64HashBytesConverter))] // AND THEY STORED IT AS A NUMBER IN A STRING WTFF??????
15 | public byte[] Xxh64Hash { get; set; } // classic
16 |
17 | [JsonPropertyName("fileSize")]
18 | [JsonNumberHandling(JsonNumberHandling.AllowReadingFromString)]
19 | public long FileSize { get; set; }
20 |
21 | [JsonPropertyName("isPatch")]
22 | public bool IsPersistentFile { get; set; }
23 |
24 | [JsonPropertyName("tags")]
25 | public int[] Tags { get; set; }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/CollapseLauncher/CollapseLauncher.csproj.DotSettings:
--------------------------------------------------------------------------------
1 |
2 | No
--------------------------------------------------------------------------------
/CollapseLauncher/Lib/libomp140.x86_64.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Lib/libomp140.x86_64.dll
--------------------------------------------------------------------------------
/CollapseLauncher/Lib/waifu2x-ncnn-vulkan.commitinfo:
--------------------------------------------------------------------------------
1 | https://github.com/shatyuka/waifu2x-ncnn-vulkan/tree/c0333749a725a96c662124cf59fded393d011792
2 |
--------------------------------------------------------------------------------
/CollapseLauncher/Lib/waifu2x-ncnn-vulkan.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/Lib/waifu2x-ncnn-vulkan.dll
--------------------------------------------------------------------------------
/CollapseLauncher/Misc/InstallMediaPack.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | echo Please do not close this console window until it finishes
3 | powershell.exe -ExecutionPolicy Bypass -Command "Get-WindowsCapability -Online | Where-Object -Property Name -Like "*Media.MediaFeaturePack*" | Add-WindowsCapability -Online"
--------------------------------------------------------------------------------
/CollapseLauncher/NonTrimmableRoots.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/CollapseLauncher/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Collapse Launcher": {
4 | "commandName": "Project",
5 | "nativeDebugging": false
6 | },
7 | "OOBE Setup": {
8 | "commandName": "Project",
9 | "commandLineArgs": "oobesetup",
10 | "nativeDebugging": false
11 | },
12 | "Updater": {
13 | "commandName": "Project",
14 | "commandLineArgs": "update --input \"C:\\Program Files\\Collapse Launcher\" --channel Preview",
15 | "nativeDebugging": false
16 | },
17 | "Elevate Updater": {
18 | "commandName": "Project",
19 | "commandLineArgs": "elevateupdate --input \"H:\\Data\\test\" --channel Preview",
20 | "nativeDebugging": false
21 | },
22 | "Reindexer": {
23 | "commandName": "Project",
24 | "commandLineArgs": "reindex --input \"\\myGit\\CollapseLauncher-ReleaseRepo\\preview\" --upver 1.0.40.5",
25 | "nativeDebugging": false
26 | },
27 | "Take Ownership": {
28 | "commandName": "Project",
29 | "commandLineArgs": "takeownership --input \"H:\\Data\\Games\\miHoYoGames\"",
30 | "nativeDebugging": false
31 | },
32 | "Migrate": {
33 | "commandName": "Project",
34 | "commandLineArgs": "migrate --input \"C:\\Program Files\\Honkai Impact 3 sea\" --output \"H:\\Games\\miHoYoGames\\Hi3SEA\"",
35 | "nativeDebugging": false
36 | },
37 | "Hi3 Cache Updater": {
38 | "commandName": "Project",
39 | "commandLineArgs": "hi3cacheupdate",
40 | "nativeDebugging": true
41 | },
42 | "Start on Tray": {
43 | "commandName": "Project",
44 | "commandLineArgs": "tray",
45 | "nativeDebugging": false
46 | },
47 | "Generate Velopack Metadata": {
48 | "commandName": "Project",
49 | "commandLineArgs": "generatevelopackmetadata",
50 | "nativeDebugging": false
51 | }
52 | }
53 | }
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/7za.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/7za.exe
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.001:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.001
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.002:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.002
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.003:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.003
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.004:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.004
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.005:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.005
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.006:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.006
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.007:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.007
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.008:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.008
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.009:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.009
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.010:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.010
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.011:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.011
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.012:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.012
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.013:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.013
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.014:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.014
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.015:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.015
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.016:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.016
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.017:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.017
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.018:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.018
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.019:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.019
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.020:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.020
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.021:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.021
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.022:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.022
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.023:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.023
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.024:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.024
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.025:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.025
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.026:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.026
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.027:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.027
--------------------------------------------------------------------------------
/CollapseLauncher/StaticLib/StaticLib.7z.028:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/StaticLib/StaticLib.7z.028
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Invoker/Classes/TakeOwnership.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.IO;
4 |
5 | namespace CollapseLauncher
6 | {
7 | public class TakeOwnership
8 | {
9 | public static void StartTakingOwnership(string target)
10 | {
11 | ArgumentException.ThrowIfNullOrEmpty(target, nameof(target));
12 |
13 | // ReSharper disable once LocalizableElement
14 | Console.WriteLine("Trying to append ownership of the folder. Please do not close this console window!");
15 |
16 | if (!Directory.Exists(target))
17 | Directory.CreateDirectory(target);
18 |
19 | Process takeOwner = new Process
20 | {
21 | StartInfo = new ProcessStartInfo
22 | {
23 | FileName = "cmd.exe",
24 | UseShellExecute = false,
25 | Arguments = $"/c icacls \"{target}\" /T /Q /C /RESET"
26 | }
27 | };
28 |
29 | takeOwner.Start();
30 | takeOwner.WaitForExit();
31 |
32 | takeOwner = new Process
33 | {
34 | StartInfo = new ProcessStartInfo
35 | {
36 | FileName = "cmd.exe",
37 | UseShellExecute = false,
38 | Arguments = $"/c takeown /f \"{target}\" /r /d y"
39 | }
40 | };
41 |
42 | takeOwner.Start();
43 | takeOwner.WaitForExit();
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/BlankPage.xaml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/BlankPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CollapseLauncher.Pages
2 | {
3 | public sealed partial class BlankPage
4 | {
5 | public BlankPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/NotInstalledPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
16 |
24 |
29 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/NotInstalledPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CollapseLauncher.Pages
2 | {
3 | public sealed partial class NotInstalledPage
4 | {
5 | public NotInstalledPage()
6 | {
7 | BackgroundImgChanger.ToggleBackground(true);
8 | InitializeComponent();
9 | }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/NullPage.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/NullPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace CollapseLauncher.Pages
2 | {
3 | public sealed partial class NullPage
4 | {
5 | public NullPage()
6 | {
7 | InitializeComponent();
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/OOBE/OOBEAgreementMenu.xaml.cs:
--------------------------------------------------------------------------------
1 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock;
2 | using Hi3Helper.Shared.Region;
3 | using Microsoft.UI.Xaml;
4 | using System.Collections.Generic;
5 | using System.IO;
6 | // ReSharper disable IdentifierTypo
7 | // ReSharper disable InconsistentNaming
8 | // ReSharper disable CheckNamespace
9 |
10 | namespace CollapseLauncher.Pages.OOBE
11 | {
12 | internal class AgreementProperty
13 | {
14 | internal AgreementProperty(string title, string filePath)
15 | {
16 | FilePath = Path.Combine(LauncherConfig.AppExecutableDir, filePath);
17 | Title = title;
18 | }
19 |
20 | internal string Text
21 | {
22 | get
23 | {
24 | return !File.Exists(FilePath) ? $"### Failed to read the file\n**{FilePath}**" : File.ReadAllText(FilePath);
25 | }
26 | }
27 | internal string Title { get; init; }
28 | internal string FilePath { get; init; }
29 | internal MarkdownConfig MarkdownConfig = new();
30 | }
31 |
32 | public static class OOBEAgreementMenuExtensions
33 | {
34 | internal static OOBEStartUpMenu OobeStartParentUI;
35 | }
36 |
37 | public sealed partial class OOBEAgreementMenu
38 | {
39 | internal List MarkdownFileList { get; } =
40 | [
41 | new("Privacy Policy (EN)", "PRIVACY.md"),
42 | new("Third Party Notices (EN)", "THIRD_PARTY_NOTICES.md")
43 | ];
44 |
45 | public OOBEAgreementMenu()
46 | {
47 | InitializeComponent();
48 | }
49 |
50 | private void Button_Click(object sender, RoutedEventArgs e)
51 | {
52 | OOBEAgreementMenuExtensions.OobeStartParentUI.StartLauncherConfiguration();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/UnavailablePage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
16 |
24 |
29 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/UnavailablePage.xaml.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.UI.Xaml.Controls;
2 | // ReSharper disable RedundantExtendsListEntry
3 |
4 | namespace CollapseLauncher.Pages
5 | {
6 | public sealed partial class UnavailablePage : Page
7 | {
8 | public UnavailablePage()
9 | {
10 | BackgroundImgChanger.ToggleBackground(true);
11 | InitializeComponent();
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/Pages/UnhandledExceptionPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using CollapseLauncher.Helper;
2 | using Microsoft.UI.Xaml;
3 | using Microsoft.UI.Xaml.Controls;
4 | using Windows.ApplicationModel.DataTransfer;
5 | using static Hi3Helper.Locale;
6 | // ReSharper disable RedundantExtendsListEntry
7 | // ReSharper disable UnusedMember.Global
8 |
9 | namespace CollapseLauncher.Pages
10 | {
11 | public sealed partial class UnhandledExceptionPage : Page
12 | {
13 | public UnhandledExceptionPage()
14 | {
15 | BackgroundImgChanger.ToggleBackground(true);
16 | InitializeComponent();
17 | ExceptionTextBox.Text = ErrorSender.ExceptionContent;
18 | Title.Text = ErrorSender.ExceptionTitle;
19 | Subtitle.Text = ErrorSender.ExceptionSubtitle;
20 |
21 | if (ErrorSender.ExceptionType == ErrorType.Connection && WindowUtility.CurrentWindow is MainWindow mainWindow && mainWindow.RootFrame.CanGoBack)
22 | BackToPreviousPage.Visibility = Visibility.Visible;
23 | }
24 |
25 | private void GoBackPreviousPage(object sender, RoutedEventArgs e) => (WindowUtility.CurrentWindow as MainWindow)?.RootFrame.GoBack();
26 |
27 | private void CopyTextToClipboard(object sender, RoutedEventArgs e)
28 | {
29 | DataPackage data = new DataPackage
30 | {
31 | RequestedOperation = DataPackageOperation.Copy
32 | };
33 | data.SetText(ErrorSender.ExceptionContent);
34 | Clipboard.SetContent(data);
35 | CopyThrow.Content = Lang._UnhandledExceptionPage.CopyClipboardBtn2;
36 | CopyThrow.IsEnabled = false;
37 | }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/MainApp/TrayIcon.xaml:
--------------------------------------------------------------------------------
1 |
8 |
17 |
18 |
19 |
21 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Prototype/MainPageNew.xaml.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper;
2 | using Microsoft.UI.Xaml;
3 | using Microsoft.UI.Xaml.Controls;
4 | using Microsoft.UI.Xaml.Input;
5 | using System;
6 | using static Hi3Helper.Logger;
7 | // ReSharper disable RedundantExtendsListEntry
8 | // ReSharper disable UnusedMember.Global
9 |
10 | namespace CollapseLauncher.Prototype
11 | {
12 | public partial class MainPageNew : Page
13 | {
14 | public MainPageNew()
15 | {
16 | try
17 | {
18 | InitializeComponent();
19 | }
20 | catch (Exception ex)
21 | {
22 | LogWriteLine($"FATAL CRASH!!!\r\n{ex}", LogType.Error, true);
23 | ErrorSender.SendException(ex);
24 | }
25 | }
26 |
27 | private void nvSample_PaneOpening(NavigationView sender, object args)
28 | {
29 | Thickness curMargin = GridBG_Icon.Margin;
30 | curMargin.Left = 48;
31 | GridBG_Icon.Margin = curMargin;
32 | GridBG_IconTitle.Width = double.NaN;
33 | if (PreviewBuildIndicator.Visibility == Visibility.Collapsed)
34 | GridBG_IconTitle.Visibility = Visibility.Visible;
35 | }
36 |
37 | private void nvSample_PaneClosing(NavigationView sender, NavigationViewPaneClosingEventArgs args)
38 | {
39 | Thickness curMargin = GridBG_Icon.Margin;
40 | curMargin.Left = 58;
41 | GridBG_IconTitle.Width = 0;
42 | GridBG_Icon.Margin = curMargin;
43 | if (PreviewBuildIndicator.Visibility == Visibility.Collapsed)
44 | GridBG_IconTitle.Visibility = Visibility.Collapsed;
45 | }
46 |
47 | private void NotificationContainerBackground_PointerPressed(object sender, PointerRoutedEventArgs e)
48 | {
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/CommitInfo:
--------------------------------------------------------------------------------
1 | https://github.com/CommunityToolkit/Labs-Windows/commit/d50095f5bbb1db559d90675c50b9cf23ae0e2a4f
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/Contributing.md:
--------------------------------------------------------------------------------
1 | # ✨ Contributing to the Windows Community Toolkit Labs
2 |
3 | Thank you for exhibiting interest in contributing to the Windows Community Toolkit. The team is delighted to welcome you onboard to our exciting and growing project. Any contribution or value added go a long way to enhance the project!
4 |
5 | Please bear with us as we onboard to this new process using Windows Community Toolkit Labs.
6 |
7 | **Note:** _In Preview we're currently not accepting new experiments beyond our trial list to ensure our infrastructure is stabilized, if you'd like to contribute [please see where you can lend a hand with Labs itself here](https://github.com/CommunityToolkit/Labs-Windows/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)_ [If you have an idea for a component though, please feel free to open a discussion here.](https://github.com/CommunityToolkit/Labs-Windows/discussions?discussions_q=category%3AExperiments+category%3A%22Ideas%22+)
8 |
9 | ## ❔ Questions
10 |
11 | Due to the high volume of incoming issues please keep our GitHub issues for bug reports about the Labs infrastructure itself. For general questions and discussions (including new features), [please open up a discussion (if one doesn't exist already)](https://github.com/CommunityToolkit/Labs-Windows/discussions). You can [also reach out in the `#community-toolkit` channel on Discord here](https://aka.ms/wct/discord)
12 |
13 | ## 🙋 Help Wanted
14 |
15 | We have a list of issues that are labeled as [help wanted](https://github.com/CommunityToolkit/Labs-Windows/labels/help%20wanted). Note, the level of complexity in the list can vary, but feel free to jump in to help solve these issues. Be sure to comment on issues first where you'd like to help out to coordinate with others in the community.
16 |
17 | ## 💙 Thank You
18 |
19 | **Thank you so much for contributing to this amazing project. We hope you will continue to add value and find yourself as a highly reliable source to the Windows Community Toolkit.**
20 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/License.md:
--------------------------------------------------------------------------------
1 | # Windows Community Toolkit
2 |
3 | Copyright © .NET Foundation and Contributors
4 |
5 | All rights reserved.
6 |
7 | ## MIT License (MIT)
8 |
9 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/DefaultSVGRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml.Controls;
6 | using Microsoft.UI.Xaml.Media.Imaging;
7 | using System;
8 | using System.IO;
9 | using System.Threading.Tasks;
10 | // ReSharper disable InconsistentNaming
11 |
12 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock;
13 |
14 | internal class DefaultSVGRenderer : ISVGRenderer
15 | {
16 | public async Task SvgToImage(string svgString)
17 | {
18 | SvgImageSource svgImageSource = new SvgImageSource();
19 | var image = new Image();
20 | // Create a MemoryStream object and write the SVG string to it
21 | using (var memoryStream = new MemoryStream())
22 | await using (var streamWriter = new StreamWriter(memoryStream))
23 | {
24 | await streamWriter.WriteAsync(svgString);
25 | await streamWriter.FlushAsync();
26 |
27 | // Rewind the MemoryStream
28 | memoryStream.Position = 0;
29 |
30 | // Load the SVG from the MemoryStream
31 | await svgImageSource.SetSourceAsync(memoryStream.AsRandomAccessStream());
32 | }
33 |
34 | // Set the Source property of the Image control to the SvgImageSource object
35 | image.Source = svgImageSource;
36 | var size = Extensions.GetSvgSize(svgString);
37 | if (size.Width != 0)
38 | {
39 | image.Width = size.Width;
40 | }
41 | if (size.Height != 0)
42 | {
43 | image.Height = size.Height;
44 | }
45 | return image;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/IImageProvider.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml.Controls;
6 | using System.Threading.Tasks;
7 |
8 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock;
9 |
10 | public interface IImageProvider
11 | {
12 | Task GetImage(string url);
13 | bool ShouldUseThisProvider(string url);
14 | }
15 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/ISVGRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml.Controls;
6 | using System.Threading.Tasks;
7 | // ReSharper disable InconsistentNaming
8 |
9 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock;
10 |
11 | public interface ISVGRenderer
12 | {
13 | Task SvgToImage(string svgString);
14 | }
15 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/MarkdownConfig.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | // ReSharper disable UnusedAutoPropertyAccessor.Global
6 | // ReSharper disable InconsistentNaming
7 | // ReSharper disable CheckNamespace
8 | #nullable enable
9 | using CommunityToolkit.WinUI.Controls.MarkdownTextBlockRns;
10 |
11 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock;
12 |
13 | public record MarkdownConfig
14 | {
15 | public string? BaseUrl { get; set; }
16 | public IImageProvider? ImageProvider { get; set; }
17 | public ISVGRenderer? SVGRenderer { get; set; }
18 | public MarkdownThemes Themes { get; set; } = MarkdownThemes.Default;
19 | public static MarkdownConfig Default { get; set; } = new();
20 | }
21 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/MarkdownTextBlock.xaml:
--------------------------------------------------------------------------------
1 |
4 |
6 |
23 |
24 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/CodeBlockRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax;
8 |
9 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers;
10 |
11 | internal class CodeBlockRenderer : MarkdownObjectRenderer
12 | {
13 | protected override void Write(WinUIRenderer renderer, CodeBlock obj)
14 | {
15 | var code = new MyCodeBlock(obj, renderer.Config);
16 | renderer.Push(code);
17 | renderer.Pop();
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Extensions/TaskListRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Extensions.TaskLists;
7 | using Markdig.Renderers;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Extensions;
11 |
12 | internal class TaskListRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, TaskList taskList)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (taskList == null) throw new ArgumentNullException(nameof(taskList));
18 |
19 | var checkBox = new MyTaskListCheckBox(taskList);
20 | renderer.WriteInline(checkBox);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/HeadingRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers;
11 |
12 | internal class HeadingRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, HeadingBlock obj)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (obj == null) throw new ArgumentNullException(nameof(obj));
18 |
19 | var paragraph = new MyHeading(obj, renderer.Config);
20 | renderer.Push(paragraph);
21 | renderer.WriteLeafInline(obj);
22 | renderer.Pop();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/HtmlBlockRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using HtmlAgilityPack;
6 | using Markdig.Helpers;
7 | using Markdig.Renderers;
8 | using Markdig.Syntax;
9 | using System;
10 | using System.Text;
11 | using System.Text.RegularExpressions;
12 |
13 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers;
14 |
15 | internal partial class HtmlBlockRenderer : MarkdownObjectRenderer
16 | {
17 | [GeneratedRegex(@"\t|\n|\r", RegexOptions.NonBacktracking, 10000)]
18 | internal static partial Regex GetTabAndNewLineMatch();
19 |
20 | [GeneratedRegex(" ", RegexOptions.NonBacktracking, 10000)]
21 | internal static partial Regex GetNonBreakingSpaceMatch();
22 |
23 | protected override void Write(WinUIRenderer renderer, HtmlBlock obj)
24 | {
25 | ArgumentNullException.ThrowIfNull(renderer);
26 | ArgumentNullException.ThrowIfNull(obj);
27 |
28 | StringBuilder stringBuilder = new();
29 | foreach (StringLine line in obj.Lines.Lines)
30 | {
31 | string lineText = line.Slice.ToString().Trim();
32 | if (string.IsNullOrWhiteSpace(lineText))
33 | {
34 | continue;
35 | }
36 | stringBuilder.AppendLine(lineText);
37 | }
38 |
39 | string html = GetTabAndNewLineMatch().Replace(stringBuilder.ToString(), "");
40 | html = GetNonBreakingSpaceMatch().Replace(html, " ");
41 | HtmlDocument doc = new();
42 | doc.LoadHtml(html);
43 | HtmlWriter.WriteHtml(renderer, doc.DocumentNode.ChildNodes);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/AutoLinkInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax.Inlines;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
11 |
12 | internal class AutoLinkInlineRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, AutolinkInline link)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (link == null) throw new ArgumentNullException(nameof(link));
18 |
19 | var url = link.Url;
20 | if (link.IsEmail)
21 | {
22 | url = "mailto:" + url;
23 | }
24 |
25 | if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
26 | {
27 | url = "#";
28 | }
29 |
30 | var autolink = new MyAutolinkInline(link);
31 |
32 | renderer.Push(autolink);
33 |
34 | renderer.WriteText(url);
35 | renderer.Pop();
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/CodeInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax.Inlines;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
11 |
12 | internal class CodeInlineRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, CodeInline obj)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (obj == null) throw new ArgumentNullException(nameof(obj));
18 |
19 | renderer.WriteInline(new MyInlineCode(obj, renderer.Config));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/ContainerInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Markdig.Renderers;
6 | using Markdig.Syntax.Inlines;
7 |
8 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
9 |
10 | internal class ContainerInlineRenderer : MarkdownObjectRenderer
11 | {
12 | protected override void Write(WinUIRenderer renderer, ContainerInline obj)
13 | {
14 | foreach (var inline in obj)
15 | {
16 | renderer.Write(inline);
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/DelimiterInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Markdig.Renderers;
6 | using Markdig.Syntax.Inlines;
7 | using System;
8 | // ReSharper disable GrammarMistakeInComment
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
11 |
12 | internal class DelimiterInlineRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, DelimiterInline obj)
15 | {
16 | ArgumentNullException.ThrowIfNull(renderer, nameof(renderer));
17 | ArgumentNullException.ThrowIfNull(obj, nameof(obj));
18 |
19 | // delimiters children are emphasized text, we don't need to explicitly render them
20 | // Just need to render the children of the delimiter, I think..
21 | //renderer.WriteText(obj.ToLiteral());
22 | renderer.WriteChildren(obj);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/EmphasisInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | #nullable enable
6 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
7 | using Markdig.Renderers;
8 | using Markdig.Syntax.Inlines;
9 | using System;
10 |
11 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
12 |
13 | internal class EmphasisInlineRenderer : MarkdownObjectRenderer
14 | {
15 | protected override void Write(WinUIRenderer renderer, EmphasisInline obj)
16 | {
17 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
18 | if (obj == null) throw new ArgumentNullException(nameof(obj));
19 |
20 | MyEmphasisInline? span = null;
21 |
22 | switch (obj.DelimiterChar)
23 | {
24 | case '*':
25 | case '_':
26 | span = new MyEmphasisInline();
27 | if (obj.DelimiterCount == 2) { span.SetBold(); } else { span.SetItalic(); }
28 | break;
29 | case '~':
30 | span = new MyEmphasisInline();
31 | if (obj.DelimiterCount == 2) { span.SetStrikeThrough(); } else { span.SetSubscript(); }
32 | break;
33 | case '^':
34 | span = new MyEmphasisInline();
35 | span.SetSuperscript();
36 | break;
37 | }
38 |
39 | if (span != null)
40 | {
41 | renderer.Push(span);
42 | renderer.WriteChildren(obj);
43 | renderer.Pop();
44 | }
45 | else
46 | {
47 | renderer.WriteChildren(obj);
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/HtmlEntityInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Markdig.Renderers;
6 | using Markdig.Syntax.Inlines;
7 | using System;
8 |
9 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
10 |
11 | internal class HtmlEntityInlineRenderer : MarkdownObjectRenderer
12 | {
13 | protected override void Write(WinUIRenderer renderer, HtmlEntityInline obj)
14 | {
15 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
16 | if (obj == null) throw new ArgumentNullException(nameof(obj));
17 |
18 | var transcoded = obj.Transcoded;
19 | renderer.WriteText(ref transcoded);
20 | // todo: wtf is this?
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/HtmlInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using HtmlAgilityPack;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax.Inlines;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
11 |
12 | internal class HtmlInlineRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, HtmlInline obj)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (obj == null) throw new ArgumentNullException(nameof(obj));
18 |
19 | var html = obj.Tag;
20 | var doc = new HtmlDocument();
21 | doc.LoadHtml(html);
22 | HtmlWriter.WriteHtml(renderer, doc.DocumentNode.ChildNodes);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/LineBreakInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax.Inlines;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
11 |
12 | internal class LineBreakInlineRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, LineBreakInline obj)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (obj == null) throw new ArgumentNullException(nameof(obj));
18 |
19 | if (obj.IsHard)
20 | {
21 | renderer.WriteInline(new MyLineBreak());
22 | }
23 | else
24 | {
25 | // Soft line break.
26 | renderer.WriteText(" ");
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/LinkInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | #nullable enable
6 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
7 | using Markdig.Renderers;
8 | using Markdig.Syntax.Inlines;
9 | using System;
10 |
11 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
12 |
13 | internal class LinkInlineRenderer : MarkdownObjectRenderer
14 | {
15 | protected override void Write(WinUIRenderer renderer, LinkInline link)
16 | {
17 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
18 | if (link == null) throw new ArgumentNullException(nameof(link));
19 |
20 | var url = link.GetDynamicUrl != null ? link.GetDynamicUrl() : link.Url;
21 |
22 | if (!Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute))
23 | {
24 | url = "#";
25 | }
26 |
27 | if (link.IsImage)
28 | {
29 | var image = new MyImage(link, Labs.MarkdownTextBlock.Extensions.GetUri(url, renderer.Config.BaseUrl), renderer.Config);
30 | renderer.WriteInline(image);
31 | }
32 | else
33 | {
34 | if (link.FirstChild is LinkInline { IsImage: true })
35 | {
36 | renderer.Push(new MyHyperlinkButton(link, renderer.Config.BaseUrl));
37 | }
38 | else
39 | {
40 | var hyperlink = new MyHyperlink(link, renderer.Config.BaseUrl);
41 |
42 | renderer.Push(hyperlink);
43 | }
44 |
45 | renderer.WriteChildren(link);
46 | renderer.Pop();
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/Inlines/LiteralInlineRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Markdig.Renderers;
6 | using Markdig.Syntax.Inlines;
7 | using System;
8 |
9 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers.Inlines;
10 |
11 | internal class LiteralInlineRenderer : MarkdownObjectRenderer
12 | {
13 | protected override void Write(WinUIRenderer renderer, LiteralInline obj)
14 | {
15 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
16 | if (obj == null) throw new ArgumentNullException(nameof(obj));
17 |
18 | if (obj.Content.IsEmpty)
19 | return;
20 |
21 | renderer.WriteText(ref obj.Content);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/ListRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers;
11 |
12 | internal class ListRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, ListBlock listBlock)
15 | {
16 | if (renderer == null) throw new ArgumentException(nameof(renderer));
17 | if (listBlock == null) throw new ArgumentNullException(nameof(listBlock));
18 |
19 | var list = new MyList(listBlock);
20 |
21 | renderer.Push(list);
22 |
23 | foreach (var item in listBlock)
24 | {
25 | var listItemBlock = (ListItemBlock)item;
26 | var listItem = new MyBlockContainer();
27 | renderer.Push(listItem);
28 | renderer.WriteChildren(listItemBlock);
29 | renderer.Pop();
30 | }
31 |
32 | renderer.Pop();
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/ParagraphRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers;
11 |
12 | internal class ParagraphRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, ParagraphBlock obj)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (obj == null) throw new ArgumentNullException(nameof(obj));
18 |
19 | var paragraph = new MyParagraph();
20 | // set style
21 | renderer.Push(paragraph);
22 | renderer.WriteLeafInline(obj);
23 | renderer.Pop();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/QuoteBlockRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers;
11 |
12 | internal class QuoteBlockRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, QuoteBlock obj)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (obj == null) throw new ArgumentNullException(nameof(obj));
18 |
19 | var quote = new MyQuote();
20 |
21 | renderer.Push(quote);
22 | renderer.WriteChildren(obj);
23 | renderer.Pop();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/ObjectRenderers/ThematicBreakRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax;
8 | using System;
9 |
10 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers.ObjectRenderers;
11 |
12 | internal class ThematicBreakRenderer : MarkdownObjectRenderer
13 | {
14 | protected override void Write(WinUIRenderer renderer, ThematicBreakBlock obj)
15 | {
16 | if (renderer == null) throw new ArgumentNullException(nameof(renderer));
17 | if (obj == null) throw new ArgumentNullException(nameof(obj));
18 |
19 | var thematicBreak = new MyThematicBreak();
20 |
21 | renderer.WriteBlock(thematicBreak);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/Renderers/UWPObjectRenderer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.Renderers;
6 | using Markdig.Renderers;
7 | using Markdig.Syntax;
8 | // ReSharper disable UnusedMember.Global
9 | // ReSharper disable InconsistentNaming
10 |
11 | namespace CommunityToolkit.Labs.WinUI.MarkdownTextBlock.Renderers;
12 |
13 | public abstract class UWPObjectRenderer : MarkdownObjectRenderer
14 | where TObject : MarkdownObject;
15 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/Html/MyInline.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml;
6 | using Microsoft.UI.Xaml.Controls;
7 | using Microsoft.UI.Xaml.Documents;
8 |
9 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements.Html;
10 |
11 | internal class MyInline : IAddChild
12 | {
13 | private readonly Paragraph _paragraph;
14 | private readonly InlineUIContainer _inlineUIContainer;
15 |
16 | public TextElement TextElement
17 | {
18 | get => _inlineUIContainer;
19 | }
20 |
21 | public MyInline()
22 | {
23 | _paragraph = new Paragraph();
24 | _inlineUIContainer = new InlineUIContainer();
25 | RichTextBlock richTextBlock = new RichTextBlock();
26 | richTextBlock.Blocks.Add(_paragraph);
27 |
28 | richTextBlock.HorizontalAlignment = HorizontalAlignment.Stretch;
29 | _inlineUIContainer.Child = richTextBlock;
30 | }
31 |
32 | public void AddChild(IAddChild child)
33 | {
34 | if (child.TextElement is Inline inlineChild)
35 | {
36 | _paragraph.Inlines.Add(inlineChild);
37 | }
38 | // we shouldn't support rendering block in inline
39 | // but if we want to support it, we can do it like this:
40 | //else if (child.TextElement is Block blockChild)
41 | //{
42 | // _richTextBlock.Blocks.Add(blockChild);
43 | // // if we add a new block to an inline container,
44 | // // if the next child is inline, it needs to be added after the block
45 | // // so we add a new paragraph. This way the next time
46 | // // AddChild is called, it's added to the new paragraph
47 | // _paragraph = new Paragraph();
48 | // _richTextBlock.Blocks.Add(_paragraph);
49 | //}
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/HtmlElementType.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 |
7 | public enum HtmlElementType
8 | {
9 | Block,
10 | Inline
11 | }
12 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/IAddChild.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml.Documents;
6 |
7 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
8 |
9 | public interface IAddChild
10 | {
11 | TextElement TextElement { get; }
12 | void AddChild(IAddChild child);
13 | }
14 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyAutolinkInline.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Markdig.Syntax.Inlines;
6 | using Microsoft.UI.Xaml.Documents;
7 | using System;
8 |
9 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
10 |
11 | internal class MyAutolinkInline(AutolinkInline autoLinkInline) : IAddChild
12 | {
13 | public TextElement TextElement { get; } = new Hyperlink
14 | {
15 | NavigateUri = new Uri(autoLinkInline.Url)
16 | };
17 |
18 |
19 | public void AddChild(IAddChild child)
20 | {
21 | try
22 | {
23 | var text = (MyInlineText)child;
24 | ((Hyperlink)TextElement).Inlines.Add((Run)text.TextElement);
25 | }
26 | catch (Exception ex)
27 | {
28 | throw new Exception("Error adding child to MyAutolinkInline", ex);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyBlockContainer.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml.Documents;
6 |
7 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
8 |
9 | internal class MyBlockContainer : IAddChild
10 | {
11 | private readonly MyFlowDocument _flowDocument;
12 | private readonly Paragraph _paragraph;
13 |
14 | public TextElement TextElement
15 | {
16 | get => _paragraph;
17 | }
18 |
19 | public MyBlockContainer()
20 | {
21 | InlineUIContainer inlineUIContainer = new InlineUIContainer();
22 | _flowDocument = new MyFlowDocument();
23 | inlineUIContainer.Child = _flowDocument.RichTextBlock;
24 | _paragraph = new Paragraph();
25 | _paragraph.Inlines.Add(inlineUIContainer);
26 | }
27 |
28 | public void AddChild(IAddChild child)
29 | {
30 | _flowDocument.AddChild(child);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyFlowDocument.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | #nullable enable
6 | using Microsoft.UI.Xaml.Controls;
7 | using Microsoft.UI.Xaml.Documents;
8 | using Block = Microsoft.UI.Xaml.Documents.Block;
9 | using Inline = Microsoft.UI.Xaml.Documents.Inline;
10 |
11 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
12 |
13 | public class MyFlowDocument : IAddChild
14 | {
15 | private RichTextBlock _richTextBlock = new();
16 |
17 | // useless property
18 | public TextElement TextElement { get; set; } = new Run();
19 | //
20 |
21 | public RichTextBlock RichTextBlock
22 | {
23 | get => _richTextBlock;
24 | set => _richTextBlock = value;
25 | }
26 |
27 | public void AddChild(IAddChild child)
28 | {
29 | TextElement element = child.TextElement;
30 | if (element != null)
31 | {
32 | if (element is Block block)
33 | {
34 | _richTextBlock.Blocks.Add(block);
35 | }
36 | else if (element is Inline inline)
37 | {
38 | var paragraph = new Paragraph();
39 | paragraph.Inlines.Add(inline);
40 | _richTextBlock.Blocks.Add(paragraph);
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyHyperlink.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | #nullable enable
6 | using Hi3Helper;
7 | using HtmlAgilityPack;
8 | using Markdig.Syntax.Inlines;
9 | using Microsoft.UI.Xaml.Documents;
10 | using System;
11 | using Inline = Microsoft.UI.Xaml.Documents.Inline;
12 |
13 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
14 |
15 | internal class MyHyperlink : IAddChild
16 | {
17 | private readonly Hyperlink _hyperlink;
18 |
19 | public TextElement TextElement
20 | {
21 | get => _hyperlink;
22 | }
23 |
24 | public MyHyperlink(LinkInline linkInline, string? baseUrl)
25 | {
26 | var url = linkInline.GetDynamicUrl != null ? linkInline.GetDynamicUrl() : linkInline.Url;
27 | _hyperlink = new Hyperlink
28 | {
29 | NavigateUri = Extensions.GetUri(url, baseUrl)
30 | };
31 | }
32 |
33 | public MyHyperlink(HtmlNode htmlNode, string? baseUrl)
34 | {
35 | var url = htmlNode.GetAttributeValue("href", "#");
36 | _hyperlink = new Hyperlink
37 | {
38 | NavigateUri = Extensions.GetUri(url, baseUrl)
39 | };
40 | }
41 |
42 | public void AddChild(IAddChild child)
43 | {
44 | if (child.TextElement is Inline inlineChild)
45 | {
46 | try
47 | {
48 | _hyperlink.Inlines.Add(inlineChild);
49 | // TODO: Add support for click handler
50 | }
51 | catch (Exception ex)
52 | {
53 | Logger.LogWriteLine($"[MyHyperlink::AddChild()] Failed while adding inlines\r\n{ex}", LogType.Error, true);
54 | }
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyInlineCode.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | #nullable enable
6 | using Markdig.Syntax.Inlines;
7 | using Microsoft.UI.Xaml;
8 | using Microsoft.UI.Xaml.Controls;
9 | using Microsoft.UI.Xaml.Documents;
10 | using Microsoft.UI.Xaml.Media.Media3D;
11 |
12 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
13 |
14 | internal class MyInlineCode : IAddChild
15 | {
16 | private readonly InlineUIContainer _inlineContainer;
17 |
18 | public TextElement TextElement
19 | {
20 | get => _inlineContainer;
21 | }
22 |
23 | public MyInlineCode(CodeInline codeInline, MarkdownConfig config)
24 | {
25 | _inlineContainer = new InlineUIContainer();
26 | var border = new Border
27 | {
28 | VerticalAlignment = VerticalAlignment.Bottom,
29 | Background = config.Themes.InlineCodeBackground,
30 | // border.BorderBrush = _config.Themes.InlineCodeBorderBrush;
31 | // border.BorderThickness = _config.Themes.InlineCodeBorderThickness;
32 | CornerRadius = config.Themes.InlineCodeCornerRadius,
33 | Padding = config.Themes.InlineCodePadding
34 | };
35 | CompositeTransform3D transform = new CompositeTransform3D
36 | {
37 | TranslateY = 4
38 | };
39 | border.Transform3D = transform;
40 | var textBlock = new TextBlock
41 | {
42 | FontFamily = config.Themes.InlineCodeFontFamily,
43 | FontSize = config.Themes.InlineCodeFontSize,
44 | FontWeight = config.Themes.InlineCodeFontWeight,
45 | Text = codeInline.Content
46 | };
47 | border.Child = textBlock;
48 | _inlineContainer.Child = border;
49 | }
50 |
51 |
52 | public void AddChild(IAddChild child) { }
53 | }
54 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyInlineText.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml.Documents;
6 |
7 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
8 |
9 | internal class MyInlineText(string text) : IAddChild
10 | {
11 | private readonly Run _run = new()
12 | {
13 | Text = text
14 | };
15 |
16 | public TextElement TextElement
17 | {
18 | get => _run;
19 | }
20 |
21 | public void AddChild(IAddChild child) { }
22 | }
23 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyLineBreak.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml.Documents;
6 |
7 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
8 |
9 | internal class MyLineBreak : IAddChild
10 | {
11 | private readonly LineBreak _lineBreak = new();
12 |
13 | public TextElement TextElement
14 | {
15 | get => _lineBreak;
16 | }
17 |
18 | public void AddChild(IAddChild child) { }
19 | }
20 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyParagraph.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI.Xaml;
6 | using Microsoft.UI.Xaml.Controls;
7 | using Microsoft.UI.Xaml.Documents;
8 |
9 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
10 |
11 | internal class MyParagraph : IAddChild
12 | {
13 | private readonly Paragraph _paragraph = new();
14 |
15 | public TextElement TextElement
16 | {
17 | get => _paragraph;
18 | }
19 |
20 | public void AddChild(IAddChild child)
21 | {
22 | if (child.TextElement is Inline inlineChild)
23 | {
24 | _paragraph.Inlines.Add(inlineChild);
25 | }
26 | else if (child.TextElement is Block blockChild)
27 | {
28 | var inlineUIContainer = new InlineUIContainer();
29 | var richTextBlock = new RichTextBlock
30 | {
31 | TextWrapping = TextWrapping.Wrap
32 | };
33 | richTextBlock.Blocks.Add(blockChild);
34 | inlineUIContainer.Child = richTextBlock;
35 | _paragraph.Inlines.Add(inlineUIContainer);
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyTable.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Markdig.Extensions.Tables;
6 | using Microsoft.UI;
7 | using Microsoft.UI.Xaml.Controls;
8 | using Microsoft.UI.Xaml.Documents;
9 | using Microsoft.UI.Xaml.Media;
10 | using System.Linq;
11 |
12 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
13 |
14 | internal class MyTable : IAddChild
15 | {
16 | private readonly Paragraph _paragraph;
17 | private readonly MyTableUIElement _tableElement;
18 |
19 | public TextElement TextElement
20 | {
21 | get => _paragraph;
22 | }
23 |
24 | public MyTable(Table table)
25 | {
26 | _paragraph = new Paragraph();
27 | var column = table.FirstOrDefault() is not TableRow row ? 0 : row.Count;
28 |
29 | _tableElement = new MyTableUIElement
30 | (
31 | column,
32 | table.Count,
33 | 1,
34 | new SolidColorBrush(Colors.Gray)
35 | );
36 |
37 | var inlineUIContainer = new InlineUIContainer
38 | {
39 | Child = _tableElement
40 | };
41 | _paragraph.Inlines.Add(inlineUIContainer);
42 | }
43 |
44 | public void AddChild(IAddChild child)
45 | {
46 | if (child is MyTableCell cellChild)
47 | {
48 | var cell = cellChild.Container;
49 |
50 | Grid.SetColumn(cell, cellChild.ColumnIndex);
51 | Grid.SetRow(cell, cellChild.RowIndex);
52 | Grid.SetColumnSpan(cell, cellChild.ColumnSpan);
53 | Grid.SetRowSpan(cell, cellChild.RowSpan);
54 |
55 | _tableElement.Children.Add(cell);
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyTableRow.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
6 | using Markdig.Extensions.Tables;
7 | using Microsoft.UI.Xaml.Controls;
8 | using Microsoft.UI.Xaml.Documents;
9 | // ReSharper disable All
10 |
11 | namespace CommunityToolkit.Labs.WinUI.MarkdownTextBlock.TextElements;
12 |
13 | internal class MyTableRow : IAddChild
14 | {
15 | private TableRow _tableRow;
16 | private StackPanel _stackPanel;
17 | private Paragraph _paragraph;
18 |
19 | public TextElement TextElement
20 | {
21 | get => _paragraph;
22 | }
23 |
24 | public MyTableRow(TableRow tableRow)
25 | {
26 | _tableRow = tableRow;
27 | _paragraph = new Paragraph();
28 |
29 | _stackPanel = new StackPanel();
30 | _stackPanel.Orientation = Orientation.Horizontal;
31 | var inlineUIContainer = new InlineUIContainer();
32 | inlineUIContainer.Child = _stackPanel;
33 | _paragraph.Inlines.Add(inlineUIContainer);
34 | }
35 |
36 | public void AddChild(IAddChild child)
37 | {
38 | if (child is MyTableCell cellChild)
39 | {
40 | var richTextBlock = new RichTextBlock();
41 | richTextBlock.Blocks.Add((Paragraph)cellChild.TextElement);
42 | _stackPanel.Children.Add(richTextBlock);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyTaskListCheckBox.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Markdig.Extensions.TaskLists;
6 | using Microsoft.UI;
7 | using Microsoft.UI.Xaml;
8 | using Microsoft.UI.Xaml.Controls;
9 | using Microsoft.UI.Xaml.Documents;
10 | using Microsoft.UI.Xaml.Media;
11 | using Microsoft.UI.Xaml.Media.Media3D;
12 |
13 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
14 |
15 | internal class MyTaskListCheckBox : IAddChild
16 | {
17 | public TextElement TextElement { get; }
18 |
19 | public MyTaskListCheckBox(TaskList taskList)
20 | {
21 | var grid = new Grid();
22 | CompositeTransform3D transform = new CompositeTransform3D
23 | {
24 | TranslateY = 2
25 | };
26 | grid.Transform3D = transform;
27 | grid.Width = 16;
28 | grid.Height = 16;
29 | grid.Margin = new Thickness(2, 0, 2, 0);
30 | grid.BorderThickness = new Thickness(1);
31 | grid.BorderBrush = new SolidColorBrush(Colors.Gray);
32 | FontIcon icon = new FontIcon
33 | {
34 | FontSize = 16,
35 | HorizontalAlignment = HorizontalAlignment.Center,
36 | VerticalAlignment = VerticalAlignment.Center,
37 | Glyph = "\uE73E"
38 | };
39 | grid.Children.Add(taskList.Checked ? icon : new TextBlock());
40 | grid.Padding = new Thickness(0);
41 | grid.CornerRadius = new CornerRadius(2);
42 | var inlineUIContainer = new InlineUIContainer
43 | {
44 | Child = grid
45 | };
46 | TextElement = inlineUIContainer;
47 | }
48 |
49 | public void AddChild(IAddChild child)
50 | {
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/CommunityToolkit.Labs/MarkdownTextBlock/TextElements/MyThematicBreak.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | using Microsoft.UI;
6 | using Microsoft.UI.Xaml;
7 | using Microsoft.UI.Xaml.Controls;
8 | using Microsoft.UI.Xaml.Documents;
9 | using Microsoft.UI.Xaml.Media;
10 |
11 | namespace CommunityToolkit.Labs.WinUI.Labs.MarkdownTextBlock.TextElements;
12 |
13 | internal class MyThematicBreak : IAddChild
14 | {
15 | private readonly Paragraph _paragraph;
16 |
17 | public TextElement TextElement
18 | {
19 | get => _paragraph;
20 | }
21 |
22 | public MyThematicBreak()
23 | {
24 | _paragraph = new Paragraph();
25 |
26 | var inlineUIContainer = new InlineUIContainer();
27 | var border = new Border
28 | {
29 | Width = 500,
30 | BorderThickness = new Thickness(1),
31 | Margin = new Thickness(0, 4, 0, 4),
32 | BorderBrush = new SolidColorBrush(Colors.Gray),
33 | Height = 1,
34 | HorizontalAlignment = HorizontalAlignment.Stretch
35 | };
36 | inlineUIContainer.Child = border;
37 | _paragraph.Inlines.Add(inlineUIContainer);
38 | }
39 |
40 | public void AddChild(IAddChild child) { }
41 | }
42 |
--------------------------------------------------------------------------------
/CollapseLauncher/XAMLs/Theme/CustomControls/UserFeedbackDialog/UserFeedbackDialog.Constants.cs:
--------------------------------------------------------------------------------
1 | namespace CollapseLauncher.XAMLs.Theme.CustomControls.UserFeedbackDialog
2 | {
3 | public partial class UserFeedbackDialog
4 | {
5 | private const string TemplateNameTitleGridBackgroundImage = "TitleGridBackgroundImage";
6 | private const string TemplateNameTitleGridText = "TitleGridText";
7 | private const string TemplateNameFeedbackTitleInput = "FeedbackTitleInput";
8 | private const string TemplateNameFeedbackMessageInput = "FeedbackMessageInput";
9 | private const string TemplateNameFeedbackRatingText = "FeedbackRatingText";
10 | private const string TemplateNameFeedbackRatingControl = "FeedbackRatingControl";
11 | private const string TemplateNamePrimaryButton = "PrimaryButton";
12 | private const string TemplateNameCloseButton = "CloseButton";
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/CollapseLauncher/app.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 |
5 |
6 |
7 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
30 | true/PM
31 | PerMonitorV2, PerMonitor
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/CollapseLauncher/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/CollapseLauncher/icon.ico
--------------------------------------------------------------------------------
/Docs/Imgs/CollapseLauncherIdolType.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/Docs/Imgs/CollapseLauncherIdolType.png
--------------------------------------------------------------------------------
/Docs/LICENSE/Facebook/ZSTANDARD.LICENSE:
--------------------------------------------------------------------------------
1 | BSD License
2 |
3 | For Zstandard software
4 |
5 | Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | * Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 |
13 | * Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | * Neither the name Facebook, nor Meta, nor the names of its contributors may
18 | be used to endorse or promote products derived from this software without
19 | specific prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/Docs/LICENSE/Google/PROTOBUF.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2008 Google Inc. All rights reserved.
2 |
3 | Redistribution and use in source and binary forms, with or without
4 | modification, are permitted provided that the following conditions are
5 | met:
6 |
7 | * Redistributions of source code must retain the above copyright
8 | notice, this list of conditions and the following disclaimer.
9 | * Redistributions in binary form must reproduce the above
10 | copyright notice, this list of conditions and the following disclaimer
11 | in the documentation and/or other materials provided with the
12 | distribution.
13 | * Neither the name of Google Inc. nor the names of its
14 | contributors may be used to endorse or promote products derived from
15 | this software without specific prior written permission.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 | Code generated by the Protocol Buffer compiler is owned by the owner
30 | of the input file used when generating it. This code is not
31 | standalone and requires a support library to be linked with it. This
32 | support library is itself covered by the above license.
33 |
--------------------------------------------------------------------------------
/Docs/LICENSE/Mendsley/BSDIFF.LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2003-2005 Colin Percival
2 | Copyright 2012 Matthew Endsley
3 | All rights reserved
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted providing that the following conditions
7 | are met:
8 | 1. Redistributions of source code must retain the above copyright
9 | notice, this list of conditions and the following disclaimer.
10 | 2. Redistributions in binary form must reproduce the above copyright
11 | notice, this list of conditions and the following disclaimer in the
12 | documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
18 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
22 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
23 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 | POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/Docs/LICENSE/Nihui/WAIFU2X.LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2019 nihui
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/ImageCropper/BitmapFileFormat.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
6 |
7 | ///
8 | /// This denotes the format used when saving a bitmap to a file.
9 | ///
10 | public enum BitmapFileFormat
11 | {
12 | ///
13 | /// Indicates Windows Imaging Component's bitmap encoder.
14 | ///
15 | Bmp,
16 |
17 | ///
18 | /// Indicates Windows Imaging Component's PNG encoder.
19 | ///
20 | Png,
21 |
22 | ///
23 | /// Indicates Windows Imaging Component's bitmap JPEG encoder.
24 | ///
25 | Jpeg,
26 |
27 | ///
28 | /// Indicates Windows Imaging Component's TIFF encoder.
29 | ///
30 | Tiff,
31 |
32 | ///
33 | /// Indicates Windows Imaging Component's GIF encoder.
34 | ///
35 | Gif,
36 |
37 | ///
38 | /// Indicates Windows Imaging Component's JPEGXR encoder.
39 | ///
40 | JpegXR
41 | }
42 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/ImageCropper/CropShape.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
6 |
7 | ///
8 | /// Crop shape enumeration.
9 | /// Default is
10 | ///
11 | public enum CropShape
12 | {
13 | ///
14 | /// Use rectangular shape to crop image.
15 | ///
16 | Rectangular,
17 |
18 | ///
19 | /// Use circular shape to crop image.
20 | ///
21 | Circular
22 | }
23 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/ImageCropper/Extension.cs:
--------------------------------------------------------------------------------
1 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls
2 | {
3 | internal static class Extension
4 | {
5 | [Pure]
6 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
7 | public static Rect ToRect(this Size size)
8 | {
9 | return new Rect(0, 0, size.Width, size.Height);
10 | }
11 |
12 | [Pure]
13 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
14 | public static Rect ToRect(this Point point, double width, double height)
15 | {
16 | return new Rect(point.X, point.Y, width, height);
17 | }
18 |
19 | [Pure]
20 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
21 | public static Rect ToRect(this Point point, Point end)
22 | {
23 | return new Rect(point, end);
24 | }
25 |
26 | [Pure]
27 | [MethodImpl(MethodImplOptions.AggressiveInlining)]
28 | public static Rect ToRect(this Point point, Size size)
29 | {
30 | return new Rect(point, size);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/ImageCropper/ReadMe.md:
--------------------------------------------------------------------------------
1 |
2 | # Windows Community Toolkit - ImageCropper
3 |
4 | This package is part of the [Windows Community Toolkit](https://aka.ms/toolkit/windows) from the [.NET Foundation](https://dotnetfoundation.org).
5 |
6 | ## Package Contents
7 |
8 | This package contains the following controls in the `CommunityToolkit.WinUI.Controls` namespace:
9 |
10 | - ImageCropper
11 |
12 | ## Which Package is for me?
13 |
14 | If you're developing with _UWP/WinUI 2 or Uno.UI_ you should be using the `CommunityToolkit.Uwp.Controls.ImageCropper` package.
15 |
16 | If you're developing with _WindowsAppSDK/WinUI 3 or Uno.WinUI_ you should be using the `CommunityToolkit.WinUI.Controls.ImageCropper` package.
17 |
18 | ## WinUI Resources (UWP)
19 |
20 | For UWP projects, the WinUI 2 reference requires you include the WinUI XAML Resources in your App.xaml file:
21 |
22 | ```xml
23 |
24 |
25 |
26 | ```
27 |
28 | See [Getting Started in WinUI 2](https://learn.microsoft.com/windows/apps/winui/winui2/getting-started) for more information.
29 |
30 | ## Documentation
31 |
32 | Further documentation about these components can be found at: https://aka.ms/windowstoolkitdocs
33 |
34 | ## License
35 |
36 | MIT
37 |
38 | See License.md in package for more details.
39 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/ImageCropper/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/ImageCropper/ThumbPlacement.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
6 |
7 | ///
8 | /// Thumb placement enumeration.
9 | /// Default is
10 | ///
11 | public enum ThumbPlacement
12 | {
13 | ///
14 | /// Shows the thumbs in all four corners, top, bottom, left and right.
15 | ///
16 | All,
17 |
18 | ///
19 | /// Shows the thumbs in all four corners.
20 | ///
21 | Corners
22 | }
23 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/ImageCropper/ThumbPosition.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
6 |
7 | ///
8 | /// Thumb position enumeration.
9 | ///
10 | internal enum ThumbPosition
11 | {
12 | Top,
13 | Bottom,
14 | Left,
15 | Right,
16 | UpperLeft,
17 | UpperRight,
18 | LowerLeft,
19 | LowerRight
20 | }
21 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/SettingsControls/Helpers/ControlHelper.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
6 | internal static class ControlHelpers
7 | {
8 | internal static bool IsXamlRootAvailable { get; } = Windows.Foundation.Metadata.ApiInformation.IsPropertyPresent("Microsoft.UI.Xaml.UIElement", nameof(UIElement.XamlRoot));
9 | }
10 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/SettingsControls/Helpers/CornerRadiusConverter.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | // ReSharper disable PartialTypeWithSinglePart
6 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
7 | internal partial class CornerRadiusConverter : IValueConverter
8 | {
9 | public object Convert(object value, Type targetType, object parameter, string language)
10 | {
11 | if (value is CornerRadius cornerRadius)
12 | {
13 | return new CornerRadius(0, 0, cornerRadius.BottomRight, cornerRadius.BottomLeft);
14 | }
15 |
16 | return value;
17 | }
18 |
19 | public object ConvertBack(object value, Type targetType, object parameter, string language)
20 | {
21 | return value;
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/SettingsControls/MultiTarget.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 | wasdk;
8 |
9 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/SettingsControls/ReadMe.md:
--------------------------------------------------------------------------------
1 |
2 | # Windows Community Toolkit - SettingsControls
3 |
4 | This package is part of the [Windows Community Toolkit](https://aka.ms/toolkit/windows) from the [.NET Foundation](https://dotnetfoundation.org).
5 |
6 | ## Package Contents
7 |
8 | This package contains the following controls in the `CommunityToolkit.WinUI.Controls` namespace:
9 |
10 | - SettingsCard
11 | - SettingsExpander
12 |
13 | ## Which Package is for me?
14 |
15 | If you're developing with _UWP/WinUI 2 or Uno.UI_ you should be using the `CommunityToolkit.Uwp.Controls.SettingsControls` package.
16 |
17 | If you're developing with _WindowsAppSDK/WinUI 3 or Uno.WinUI_ you should be using the `CommunityToolkit.WinUI.Controls.SettingsControls` package.
18 |
19 | ## WinUI Resources (UWP)
20 |
21 | For UWP projects, the WinUI 2 reference requires you include the WinUI XAML Resources in your App.xaml file:
22 |
23 | ```xml
24 |
25 |
26 |
27 | ```
28 |
29 | See [Getting Started in WinUI 2](https://learn.microsoft.com/windows/apps/winui/winui2/getting-started) for more information.
30 |
31 | ## Documentation
32 |
33 | Further documentation about these components can be found at: https://aka.ms/windowstoolkitdocs
34 |
35 | ## License
36 |
37 | MIT
38 |
39 | See License.md in package for more details.
40 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/SettingsControls/SettingsExpander/SettingsExpander.Events.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | #nullable enable
6 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
7 |
8 | public partial class SettingsExpander
9 | {
10 | ///
11 | /// Fires when the SettingsExpander is opened
12 | ///
13 | public event EventHandler? Expanded;
14 |
15 | ///
16 | /// Fires when the expander is closed
17 | ///
18 | public event EventHandler? Collapsed;
19 | }
20 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/SettingsControls/SettingsExpander/SettingsExpanderItemStyleSelector.cs:
--------------------------------------------------------------------------------
1 | // Licensed to the .NET Foundation under one or more agreements.
2 | // The .NET Foundation licenses this file to you under the MIT license.
3 | // See the LICENSE file in the project root for more information.
4 |
5 | // ReSharper disable PartialTypeWithSinglePart
6 | namespace Hi3Helper.CommunityToolkit.WinUI.Controls;
7 |
8 | ///
9 | /// used by to choose the proper container style (clickable or not).
10 | ///
11 | public partial class SettingsExpanderItemStyleSelector : StyleSelector
12 | {
13 | ///
14 | /// Gets or sets the default .
15 | ///
16 | public Style DefaultStyle { get; set; }
17 |
18 | ///
19 | /// Gets or sets the when clickable.
20 | ///
21 | public Style ClickableStyle { get; set; }
22 |
23 | ///
24 | /// Initializes a new instance of the class.
25 | ///
26 | public SettingsExpanderItemStyleSelector()
27 | {
28 | }
29 |
30 | ///
31 | protected override Style SelectStyleCore(object item, DependencyObject container)
32 | {
33 | if (container is SettingsCard card && card.IsClickEnabled)
34 | {
35 | return ClickableStyle;
36 | }
37 |
38 | return DefaultStyle;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/SettingsControls/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Hi3Helper.CommunityToolkit/commitinfo.txt:
--------------------------------------------------------------------------------
1 | https://github.com/CommunityToolkit/Windows/commit/44d3d9d3601bb543625078fbbab55a2a867b0662
--------------------------------------------------------------------------------
/Hi3Helper.Core/Classes/Logger/Enum/LogType.cs:
--------------------------------------------------------------------------------
1 | namespace Hi3Helper
2 | {
3 | public enum LogType
4 | {
5 | Error,
6 | Warning,
7 | Default,
8 | Scheme,
9 | NoTag,
10 | Game,
11 | Debug,
12 | GLC,
13 | Sentry
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Classes/Logger/Logger.cs:
--------------------------------------------------------------------------------
1 | namespace Hi3Helper
2 | {
3 | #nullable enable
4 | public static class Logger
5 | {
6 | public static ILog? CurrentLogger { get; set; }
7 | public static void LogWriteLine() => CurrentLogger?.LogWriteLine();
8 | public static void LogWriteLine(string line, LogType type = LogType.Default, bool writeToLog = false) => CurrentLogger?.LogWriteLine(line, type, writeToLog);
9 | public static void LogWrite(string line, LogType type = LogType.Default, bool writeToLog = false, bool resetLinePosition = false) => CurrentLogger?.LogWrite(line, type, writeToLog, resetLinePosition);
10 | public static void WriteLog(string line, LogType type = LogType.Default) => CurrentLogger?.WriteLog(line, type);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Classes/Logger/Type/LoggerNull.cs:
--------------------------------------------------------------------------------
1 | using System.Text;
2 | // ReSharper disable MethodOverloadWithOptionalParameter
3 |
4 | namespace Hi3Helper
5 | {
6 | public class LoggerNull(string folderPath, Encoding encoding) : LoggerBase(folderPath, encoding), ILog
7 | {
8 | ~LoggerNull() => DisposeBase();
9 |
10 | #region Methods
11 | public void Dispose() => DisposeBase();
12 | public override void LogWriteLine() { }
13 | public override void LogWriteLine(string line = null) { }
14 | public override void LogWriteLine(string line, LogType type) { }
15 | public override void LogWriteLine(string line, LogType type, bool writeToLog)
16 | {
17 | if (writeToLog) WriteLog(line, type);
18 | }
19 |
20 | public override void LogWrite(string line, LogType type, bool writeToLog, bool resetLinePosition)
21 | {
22 | if (writeToLog) WriteLog(line, type);
23 | }
24 | #endregion
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Classes/Preset/Classes/ClassesContext.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.EncTool.Parser.AssetIndex;
2 | using Hi3Helper.Shared.ClassStruct;
3 | using System.Collections.Generic;
4 | using System.Text.Json.Serialization;
5 | using static Hi3Helper.Locale;
6 | // ReSharper disable PartialTypeWithSinglePart
7 |
8 | namespace Hi3Helper
9 | {
10 | [JsonSourceGenerationOptions(IncludeFields = true,
11 | GenerationMode = JsonSourceGenerationMode.Metadata,
12 | IgnoreReadOnlyFields = false,
13 | DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
14 | [JsonSerializable(typeof(DataProperties))]
15 | [JsonSerializable(typeof(PkgVersionProperties))]
16 | [JsonSerializable(typeof(DataPropertiesContent))]
17 | [JsonSerializable(typeof(FilePropertiesRemote[]))]
18 | [JsonSerializable(typeof(List))]
19 | [JsonSerializable(typeof(Dictionary))]
20 | public sealed partial class CoreLibraryJsonContext : JsonSerializerContext;
21 |
22 | [JsonSourceGenerationOptions(IncludeFields = true, GenerationMode = JsonSourceGenerationMode.Metadata, IgnoreReadOnlyFields = true)]
23 | [JsonSerializable(typeof(LocalizationParams))]
24 | [JsonSerializable(typeof(LocalizationParamsBase))]
25 | internal sealed partial class CoreLibraryFieldsJsonContext : JsonSerializerContext;
26 | }
27 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Classes/Preset/Classes/XMFClasses.cs:
--------------------------------------------------------------------------------
1 | // ReSharper disable InconsistentNaming
2 | namespace Hi3Helper.Preset
3 | {
4 | public class XMFBlockList
5 | {
6 | // XMF Block Section
7 | public string BlockHash { get; set; }
8 | public long BlockSize { get; set; }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Classes/SentryHelper/SentryEventProcessor.cs:
--------------------------------------------------------------------------------
1 | using Sentry;
2 | using Sentry.Extensibility;
3 | using static Hi3Helper.Logger;
4 |
5 | namespace Hi3Helper.SentryHelper
6 | {
7 | #nullable enable
8 | public class SentryEventProcessor : ISentryEventProcessor
9 | {
10 | // This is to follow the default implementation of the interface
11 | // ReSharper disable once ReturnTypeCanBeNotNullable
12 | public SentryEvent? Process(SentryEvent @event)
13 | {
14 | var log =
15 | $"Sentry event caught! ID: {@event.EventId}, Level: {@event.Level}, Source: {@event.Exception?.Source}" +
16 | $"{(string.IsNullOrEmpty(@event.Message?.Formatted) ? "" : $"\r\n{@event.Message?.Formatted}")}";
17 | LogWriteLine(log, LogType.Sentry, true); // Use our logger
18 | return @event; // Pipe em back up
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/Hi3Helper.Core/Classes/Shared/ClassStruct/StructsEnums.cs:
--------------------------------------------------------------------------------
1 | using Hi3Helper.Data;
2 |
3 | namespace Hi3Helper.Shared.ClassStruct
4 | {
5 | public class AppIniProperty
6 | {
7 | public IniFile Profile { get; set; } = new();
8 | public string ProfilePath { get; set; }
9 | }
10 |
11 | public enum AppThemeMode
12 | {
13 | Default = 0,
14 | Light = 1,
15 | Dark = 2,
16 | }
17 |
18 | public enum GameInstallStateEnum
19 | {
20 | Installed = 0,
21 | InstalledHavePreload = 1,
22 | NotInstalled = 2,
23 | NeedsUpdate = 3,
24 | GameBroken = 4,
25 | InstalledHavePlugin = 5,
26 | }
27 |
28 | public enum CachesType
29 | {
30 | Data = 0,
31 | Event = 1,
32 | AI = 2
33 | }
34 |
35 | public enum CachesDataStatus
36 | {
37 | New = 0,
38 | Obsolete = 1,
39 | Unused = 2
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Lang/Locale/LangBackgroundNotification.cs:
--------------------------------------------------------------------------------
1 | using WinRT;
2 | // ReSharper disable PartialTypeWithSinglePart
3 | // ReSharper disable InconsistentNaming
4 | // ReSharper disable IdentifierTypo
5 |
6 | namespace Hi3Helper
7 | {
8 | public sealed partial class Locale
9 | {
10 | #region BackgroundNotification
11 | public sealed partial class LocalizationParams
12 | {
13 | public LangBackgroundNotification _BackgroundNotification { get; set; } = LangFallback?._BackgroundNotification;
14 |
15 | [GeneratedBindableCustomProperty]
16 | public sealed partial class LangBackgroundNotification
17 | {
18 | public string LoadingTitle { get; set; } = LangFallback?._BackgroundNotification.LoadingTitle;
19 | public string Placeholder { get; set; } = LangFallback?._BackgroundNotification.Placeholder;
20 | public string CategoryTitle_Downloading { get; set; } = LangFallback?._BackgroundNotification.CategoryTitle_Downloading;
21 | public string CategoryTitle_DownloadingPreload { get; set; } = LangFallback?._BackgroundNotification.CategoryTitle_DownloadingPreload;
22 | public string CategoryTitle_Updating { get; set; } = LangFallback?._BackgroundNotification.CategoryTitle_Updating;
23 | public string NotifBadge_Completed { get; set; } = LangFallback?._BackgroundNotification.NotifBadge_Completed;
24 | public string NotifBadge_Error { get; set; } = LangFallback?._BackgroundNotification.NotifBadge_Error;
25 | }
26 | }
27 | #endregion
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Lang/Locale/LangCutscenesPage.cs:
--------------------------------------------------------------------------------
1 | using WinRT;
2 | // ReSharper disable PartialTypeWithSinglePart
3 | // ReSharper disable InconsistentNaming
4 | // ReSharper disable IdentifierTypo
5 |
6 | namespace Hi3Helper
7 | {
8 | public sealed partial class Locale
9 | {
10 | #region CutscenesPage
11 | public sealed partial class LocalizationParams
12 | {
13 | public LangCutscenesPage _CutscenesPage { get; set; } = LangFallback?._CutscenesPage;
14 |
15 | [GeneratedBindableCustomProperty]
16 | public sealed partial class LangCutscenesPage
17 | {
18 | public string PageTitle { get; set; } = LangFallback?._CutscenesPage.PageTitle;
19 | }
20 | }
21 | #endregion
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Lang/Locale/LangDisconnectedPage.cs:
--------------------------------------------------------------------------------
1 | using WinRT;
2 | // ReSharper disable PartialTypeWithSinglePart
3 | // ReSharper disable InconsistentNaming
4 | // ReSharper disable IdentifierTypo
5 |
6 | namespace Hi3Helper
7 | {
8 | public sealed partial class Locale
9 | {
10 | #region GameRepairPage
11 | public sealed partial class LocalizationParams
12 | {
13 | public LangDisconnectedPage _DisconnectedPage { get; set; } = LangFallback?._DisconnectedPage;
14 |
15 | [GeneratedBindableCustomProperty]
16 | public sealed partial class LangDisconnectedPage
17 | {
18 | public string PageTitle { get; set; } = LangFallback?._DisconnectedPage.PageTitle;
19 | public string Header1 { get; set; } = LangFallback?._DisconnectedPage.Header1;
20 | public string Header2 { get; set; } = LangFallback?._DisconnectedPage.Header2;
21 | public string Footer1 { get; set; } = LangFallback?._DisconnectedPage.Footer1;
22 | public string Footer2 { get; set; } = LangFallback?._DisconnectedPage.Footer2;
23 | public string Footer3 { get; set; } = LangFallback?._DisconnectedPage.Footer3;
24 | public string ShowErrorBtn { get; set; } = LangFallback?._DisconnectedPage.ShowErrorBtn;
25 | public string GoToAppSettingsBtn { get; set; } = LangFallback?._DisconnectedPage.GoToAppSettingsBtn;
26 | public string GoBackOverlayFrameBtn { get; set; } = LangFallback?._DisconnectedPage.GoBackOverlayFrameBtn;
27 | public string RegionChangerTitle { get; set; } = LangFallback?._DisconnectedPage.RegionChangerTitle;
28 | public string RegionChangerSubtitle { get; set; } = LangFallback?._DisconnectedPage.RegionChangerSubtitle;
29 | }
30 | }
31 | #endregion
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Lang/Locale/LangGameClientRegions.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Hi3Helper
4 | {
5 | public sealed partial class Locale
6 | {
7 | #region GameClientRegions
8 | public sealed partial class LocalizationParams
9 | {
10 | public Dictionary _GameClientRegions { get; set; } = LangFallback?._GameClientRegions;
11 | }
12 | #endregion
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Lang/Locale/LangGameClientTitles.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace Hi3Helper
4 | {
5 | public sealed partial class Locale
6 | {
7 | #region GameClientTitles
8 | public sealed partial class LocalizationParams
9 | {
10 | public Dictionary _GameClientTitles { get; set; } = LangFallback?._GameClientTitles;
11 | }
12 | #endregion
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Lang/Locale/LangInstallManagement.cs:
--------------------------------------------------------------------------------
1 | using WinRT;
2 | // ReSharper disable PartialTypeWithSinglePart
3 | // ReSharper disable InconsistentNaming
4 | // ReSharper disable IdentifierTypo
5 |
6 | namespace Hi3Helper
7 | {
8 | public sealed partial class Locale
9 | {
10 | #region InstallManagement
11 | public sealed partial class LocalizationParams
12 | {
13 | public LangInstallManagement _InstallMgmt { get; set; } = LangFallback?._InstallMgmt;
14 |
15 | [GeneratedBindableCustomProperty]
16 | public sealed partial class LangInstallManagement
17 | {
18 | public string IntegrityCheckTitle { get; set; } = LangFallback?._InstallMgmt.IntegrityCheckTitle;
19 | public string PreparePatchTitle { get; set; } = LangFallback?._InstallMgmt.PreparePatchTitle;
20 | public string AddtDownloadTitle { get; set; } = LangFallback?._InstallMgmt.AddtDownloadTitle;
21 | public string RepairFilesRequiredShowFilesBtn { get; set; } = LangFallback?._InstallMgmt.RepairFilesRequiredShowFilesBtn;
22 | public string RepairFilesRequiredTitle { get; set; } = LangFallback?._InstallMgmt.RepairFilesRequiredTitle;
23 | public string RepairFilesRequiredSubtitle { get; set; } = LangFallback?._InstallMgmt.RepairFilesRequiredSubtitle;
24 | }
25 | }
26 | #endregion
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Hi3Helper.Core/Lang/Locale/LangOOBEAgreementMenu.cs:
--------------------------------------------------------------------------------
1 | using WinRT;
2 | // ReSharper disable PartialTypeWithSinglePart
3 | // ReSharper disable InconsistentNaming
4 | // ReSharper disable IdentifierTypo
5 |
6 | namespace Hi3Helper
7 | {
8 | public sealed partial class Locale
9 | {
10 | #region Misc
11 | public sealed partial class LocalizationParams
12 | {
13 | public LangOOBEAgreementMenu _OOBEAgreementMenu { get; set; } = LangFallback?._OOBEAgreementMenu;
14 |
15 | [GeneratedBindableCustomProperty]
16 | public sealed partial class LangOOBEAgreementMenu
17 | {
18 | public string AgreementTitle { get; set; } = LangFallback?._OOBEAgreementMenu.AgreementTitle;
19 | }
20 | }
21 | #endregion
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Hi3Helper.EncTool.Test/Hi3Helper.EncTool.Test.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | net9.0
6 | enable
7 | enable
8 | x64
9 | true
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Hi3Helper.EncTool.Test/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Hi3Helper.EncTool.Test": {
4 | "commandName": "Project",
5 | "commandLineArgs": "BH3"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/Hi3Helper.EncTool.Test/packages.lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "dependencies": {
4 | "net9.0": {
5 | "Microsoft.NET.ILLink.Tasks": {
6 | "type": "Direct",
7 | "requested": "[9.0.5, )",
8 | "resolved": "9.0.5",
9 | "contentHash": "4L7wbb3Y4BJgIeSnmAf/C6S/qCs9rT1b0dX72uj3qo0qvUH7D0U1tU5ZlC7A3Wb8E/dXK4caOi4JkdLTVJaXhw=="
10 | }
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/Hi3Helper.TaskScheduler/FodyWeavers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Hi3Helper.TaskScheduler/Hi3Helper.TaskScheduler.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Exe
5 | netframework462
6 | disable
7 | x64
8 | x64
9 | enable
10 | en
11 | portable
12 | Task Scheduler Shell
13 | Task Scheduler Shell
14 | Collapse Launcher's Task Scheduler Shell
15 | Collapse Launcher's Task Scheduler Shell
16 | Collapse Launcher Team
17 | $(Company). neon-nyan, Cry0, bagusnl, shatyuka, gablm.
18 | Copyright 2022-2025 $(Company)
19 | 8.0
20 | 1.0.2
21 |
22 |
23 |
24 |
25 | all
26 | runtime; build; native; contentfiles; analyzers; buildtransitive; compile
27 |
28 |
29 | all
30 | runtime; build; native; contentfiles; analyzers; buildtransitive; compile
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Hi3Helper.TaskScheduler/Properties/PublishProfiles/AsRelease.pubxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | Release
8 | x64
9 | bin\publish
10 | FileSystem
11 | <_TargetId>Folder
12 | netframework462
13 | win-x64
14 |
15 |
--------------------------------------------------------------------------------
/Hi3Helper.TaskScheduler/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "Hi3Helper.TaskScheduler": {
4 | "commandName": "Project",
5 | "commandLineArgs": "RecreateIcons \"E:\\myGit\\Collapse\\CollapseLauncher\\bin\\x64\\Debug\\net9.0-windows10.0.26100.0\\win-x64\\CollapseLauncher.exe\""
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/InnoSetupHelper/InnoSetupHelper.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net9.0
5 | disable
6 | enable
7 | true
8 | x64
9 | portable
10 |
11 | InnoSetupHelper
12 | InnoSetupHelper
13 | InnoSetupHelper
14 | Module for parsing and modifying the Inno Setup Log file (unins000.dat) for Collapse Launcher
15 | Collapse Launcher Team
16 | $(Company). neon-nyan, Cry0, bagusnl, shatyuka, gablm.
17 | Copyright 2022-2025 $(Company)
18 | true
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/InnoSetupHelper/packages.lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": 1,
3 | "dependencies": {
4 | "net9.0": {
5 | "Microsoft.NET.ILLink.Tasks": {
6 | "type": "Direct",
7 | "requested": "[9.0.5, )",
8 | "resolved": "9.0.5",
9 | "contentHash": "4L7wbb3Y4BJgIeSnmAf/C6S/qCs9rT1b0dX72uj3qo0qvUH7D0U1tU5ZlC7A3Wb8E/dXK4caOi4JkdLTVJaXhw=="
10 | },
11 | "System.IO.Hashing": {
12 | "type": "Direct",
13 | "requested": "[9.0.5, )",
14 | "resolved": "9.0.5",
15 | "contentHash": "iFhbuwiertFWWVlbOtfVV2MaojUW0/eQ2AKkBcjvmWHYw2orW5OiTHPqAeB7ny5+s09EQaZaQmX4SIpGX8HUdg=="
16 | }
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/InstallerProp/WizardBannerDesign.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/InstallerProp/WizardBannerDesign.bmp
--------------------------------------------------------------------------------
/InstallerProp/WizardBannerDesign.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/InstallerProp/WizardBannerDesign.png
--------------------------------------------------------------------------------
/InstallerProp/WizardBannerDesignSmall.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/InstallerProp/WizardBannerDesignSmall.bmp
--------------------------------------------------------------------------------
/InstallerProp/WizardBannerDesignSmall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/InstallerProp/WizardBannerDesignSmall.png
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) neon-nyan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 | # Security Policy
2 |
3 | ## Supported Versions
4 | Due to frequent breaking changes from the HoYoverse/Cognosphere regarding update functionality (game repair indexes, cache files, compressed update packages, etc.), we can only guarantee support the latest Stable & Preview versions of Collapse.
5 | Additionally, due to major rework in Collapse update infrastructure, any versions of Collapse prior to 1.69.0 **is not supported** and should be updated ASAP to the latest version. This could be done by either using the new built-in updater or by doing a clean install of Collapse.
6 |
7 | | Version | Supported |
8 | |----------| ------------------ |
9 | | >=1.82.0 | :white_check_mark: |
10 | | < 1.0.73 | :x: |
11 |
12 |
13 | ## Reporting a Vulnerability
14 | Please report any vulnerability regarding Collapse Launcher here on Issues with the tag **[VULNERABILITY]** in the issue title. If you believe that the issue is severe enough to warrant anonymity, please directly contact any of the maintainer(s) over at Discord.
15 | ### List of Active Maintainers
16 |
17 | - @neon-nyan(`neonnyann`)
18 | - @Cryotechnic(`cry0`)
19 | - @bagusnl(`bagusnl`)
20 | - @shatyuka(`Shatyuka`)
21 | - @gablm(`gblm`)
22 |
23 | Please allow some time for us to process your report and get back to you at timely manner. We are volunteers and maintain this project in our free time and as such, real life situations take priority over this project.
24 |
--------------------------------------------------------------------------------
/Type Dependencies Diagram for InstallationConvert and other elements.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CollapseLauncher/Collapse/407a421221eefffeff97ff97b97e4af9552dc166/Type Dependencies Diagram for InstallationConvert and other elements.png
--------------------------------------------------------------------------------
/XamlStyler.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 |
3 | where /q xstyler
4 | if %ERRORLEVEL% neq 0 (
5 | echo xstyler is not found in your PATH.
6 | echo Install Xaml Styler console as a global tool by running the following command:
7 | echo dotnet tool install -g XamlStyler.Console
8 | pause
9 | exit
10 | )
11 |
12 | echo This tool will apply XamlStyler configured in settings.xamlstyler file for all Xamls in ./CollapseLauncher/XAMLs/ directory.
13 | pause
14 | xstyler --config ./settings.xamlstyler --directory ./CollapseLauncher/ --recursive
15 |
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "9.0.300"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/qodana.yaml:
--------------------------------------------------------------------------------
1 | version: "1.0"
2 | ide: QDNET
3 | bootstrap: git submodule sync --recursive && git -c protocol.version=2 submodule update --init --force --recursive && dotnet build CollapseLauncher -c Release
4 | dotnet:
5 | solution: CollapseLauncher.sln
6 | exclude:
7 | - name: All
8 | paths:
9 | - Hi3Helper.EncTool.Test
10 | - CollapseLauncher/XAMLs/Prototype
11 | - name: CheckNamespace
12 | - name: UnusedParameter.Local
13 | - name: UnusedMember.Local
14 | - name: RedundantArgumentDefaultValue
15 | - name: RedundantDefaultMemberInitializer
16 | - name: Xaml.BindingWithContextNotResolved
17 | - name: Xaml.ConstructorWarning
18 | - name: Xaml.InvalidResourceType
19 | - name: Xaml.StaticResourceNotResolved
20 | - name: RedundantExtendsListEntry
21 | - name: PartialTypeWithSinglePart
22 | - name: InvalidXmlDocComment
23 | include:
24 | - name: CheckDependencyLicenses
25 | - name: VulnerableLibrariesGlobal
26 | - name: RiderSecurityErrorsInspection
27 | licenseRules:
28 | - keys:
29 | - "MIT"
30 | allowed:
31 | # WinAppSDK
32 | - "MS-DXSDK-D3DX-9.29.952.3"
33 | # .NET
34 | - "MS-ASP-NET-WEB-OPTIMIZATION"
35 | - "MS-NET-LIBRARY-2019-06"
36 | # Windows SDK
37 | - "PROPRIETARY-LICENSE"
38 | # Protobuf, duh
39 | - "PROTOBUF"
40 | # System.CommandLine NuGet for some reason
41 | - "None"
42 | dependencyIgnores:
43 | # Ignore dependencies with no license
44 | # ColorCode is part of transitive dependency for H.NotifyIcon.WinUI
45 | - name: "ColorCode.Core"
46 | - name: "ColorCode.WinUI"
47 | # Microsoft...
48 | - name: "System.CommandLine"
49 | - name: "System.CommandLine.NamingConventionBinder"
50 | # huh?
51 | - name: "ThisAssembly.Constants"
52 | - name: "Libsql.Client"
53 | - name: "PolySharp"
54 | - name: "DependencyPropertyGenerator"
55 |
--------------------------------------------------------------------------------
/settings.xamlstyler:
--------------------------------------------------------------------------------
1 | {
2 | "AttributesTolerance": 1,
3 | "KeepFirstAttributeOnSameLine": true,
4 | "MaxAttributeCharactersPerLine": 0,
5 | "MaxAttributesPerLine": 1,
6 | "NewlineExemptionElements": "RadialGradientBrush, GradientStop, LinearGradientBrush, ScaleTransform, SkewTransform, RotateTransform, TranslateTransform, Trigger, Condition, Setter",
7 | "SeparateByGroups": false,
8 | "AttributeIndentation": 0,
9 | "AttributeIndentationStyle": 1,
10 | "RemoveDesignTimeReferences": false,
11 | "EnableAttributeReordering": true,
12 | "AttributeOrderingRuleGroups": [
13 | "x:Class",
14 | "xmlns, xmlns:x",
15 | "xmlns:*",
16 | "x:Key, Key, x:Name, Name, x:Uid, Uid, Title",
17 | "Grid.Row, Grid.RowSpan, Grid.Column, Grid.ColumnSpan, Canvas.Left, Canvas.Top, Canvas.Right, Canvas.Bottom",
18 | "Width, Height, MinWidth, MinHeight, MaxWidth, MaxHeight",
19 | "Margin, Padding, HorizontalAlignment, VerticalAlignment, HorizontalContentAlignment, VerticalContentAlignment, Panel.ZIndex",
20 | "*:*, *",
21 | "PageSource, PageIndex, Offset, Color, TargetName, Property, Value, StartPoint, EndPoint",
22 | "mc:Ignorable, d:IsDataSource, d:LayoutOverrides, d:IsStaticText",
23 | "Storyboard.*, From, To, Duration"
24 | ],
25 | "FirstLineAttributes": "",
26 | "OrderAttributesByName": true,
27 | "PutEndingBracketOnNewLine": false,
28 | "RemoveEndingTagOfEmptyElement": true,
29 | "SpaceBeforeClosingSlash": true,
30 | "RootElementLineBreakRule": 0,
31 | "ReorderVSM": 1,
32 | "ReorderGridChildren": false,
33 | "ReorderCanvasChildren": false,
34 | "ReorderSetters": 0,
35 | "FormatMarkupExtension": true,
36 | "NoNewLineMarkupExtensions": "x:Bind, Binding",
37 | "ThicknessSeparator": 2,
38 | "ThicknessAttributes": "Margin, Padding, BorderThickness, ThumbnailClipMargin",
39 | "FormatOnSave": true,
40 | "CommentPadding": 2,
41 | "IndentSize": 4
42 | }
--------------------------------------------------------------------------------
/transifex.yaml:
--------------------------------------------------------------------------------
1 | git:
2 | filters:
3 | - filter_type: file
4 | file_format: KEYVALUEJSON
5 | source_language: en_US
6 | source_file: Hi3Helper.Core/Lang/en_US.json
7 | translation_files_expression: 'Hi3Helper.Core/Lang/.json'
8 | ignore_dirs:
9 | - Hi3Helper.Core/Lang/Locale
10 | ignore_files:
11 | - Hi3Helper.Core/Lang/Localization.cs
--------------------------------------------------------------------------------