Skip to content

Commit

Permalink
feat: Add support for Package Description and PublisherDisplayName
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev authored and ahmed605 committed Sep 13, 2023
1 parent 2055c8c commit e012084
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/Uno.UWP/ApplicationModel/Package.Other.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ public partial class Package

private static Assembly? _entryAssembly;
private string _displayName = "";
private string _description = "";
private string _publisherDisplayName = "";

partial void InitializePlatform()
{
Expand Down Expand Up @@ -44,6 +46,18 @@ public string DisplayName
private set => _displayName = value;
}

public string Description
{
get => EnsureLocalized(_description);
private set => _description = value;
}

public string PublisherDisplayName
{
get => EnsureLocalized(_publisherDisplayName);
private set => _publisherDisplayName = value;
}

public Uri? Logo { get; set; }

internal static void SetEntryAssembly(Assembly entryAssembly)
Expand Down Expand Up @@ -96,6 +110,8 @@ private void ParsePackageManifest()
nsmgr.AddNamespace("d", "http://schemas.microsoft.com/appx/manifest/foundation/windows10");

DisplayName = doc.SelectSingleNode("/d:Package/d:Properties/d:DisplayName", nsmgr)?.InnerText ?? "";
Description = doc.SelectSingleNode("/d:Package/d:Properties/d:Description", nsmgr)?.InnerText ?? "";
PublisherDisplayName = doc.SelectSingleNode("/d:Package/d:Properties/d:PublisherDisplayName", nsmgr)?.InnerText ?? "";

var logoUri = doc.SelectSingleNode("/d:Package/d:Properties/d:Logo", nsmgr)?.InnerText ?? "";
if (Uri.TryCreate(logoUri, UriKind.RelativeOrAbsolute, out var logo))
Expand Down
5 changes: 4 additions & 1 deletion src/Uno.UWP/ApplicationModel/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,26 @@ public partial class Package
[Uno.NotImplemented]
public bool IsFramework => false;

#if (__IOS__ || __ANDROID__ || __MACOS__)
[Uno.NotImplemented]
public string Description => "";
#endif

[Uno.NotImplemented]
public bool IsBundle => false;

[Uno.NotImplemented]
public bool IsResourcePackage => false;


#if (__IOS__ || __ANDROID__ || __MACOS__)
[global::Uno.NotImplemented]
public global::System.Uri Logo => default;
#endif

#if (__IOS__ || __ANDROID__ || __MACOS__)
[Uno.NotImplemented]
public string PublisherDisplayName => "";
#endif

[Uno.NotImplemented]
public PackageStatus Status => new PackageStatus();
Expand Down

0 comments on commit e012084

Please sign in to comment.