// Copyright © 2017-2025 QL-Win Contributors // // This file is part of QuickLook program. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . using System.Collections.Generic; using System.Globalization; namespace QuickLook.Plugin.AppViewer.WgtPackageParser; public sealed class WgtInfo { /// /// Json path: @platforms /// public string[] Platforms { get; set; } /// /// Json path: id /// public string AppId { get; set; } /// /// Json path: name /// public string AppName { get; set; } /// /// Json path: plus.locales.xxx.name /// public Dictionary AppNameLocales { get; set; } = []; public string AppNameLocale { get { try { CultureInfo culture = CultureInfo.CurrentCulture; while (!AppNameLocales.ContainsKey(culture.Name)) { if (culture.Parent == CultureInfo.InvariantCulture) { culture = CultureInfo.InvariantCulture; break; } culture = culture.Parent; } return AppNameLocales[culture.Name]; } catch { return null; } } } /// /// Json path: plus.uni-app.vueVersion /// public string VueVersion { get; set; } /// /// Json path: plus.uni-app.compilerVersion /// public string CompilerVersion { get; set; } /// /// Json path: versionName.name /// public string AppVersionName { get; set; } /// /// Json path: versionName.code /// public string AppVersionCode { get; set; } /// /// Json path: description /// public string AppDescription { get; set; } /// /// Json path: descriptionLocales /// public Dictionary AppDescriptionLocales { get; set; } = []; /// /// Json path: descriptionLocales /// public string[] Permissions { get; set; } /// /// Json path: fallbackLocale /// public string FallbackLocale { get; set; } }