Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Medrano <josmed@microsoft.com>2022-06-14 19:28:45 +0300
committerGitHub <noreply@github.com>2022-06-14 19:28:45 +0300
commit7c2f097d1b2690fe1aa34a29c0c3707836369478 (patch)
treec1dc596e25f9767581deaf178cc509d2bdb7f3c5
parentfacd67f222ff326c28d2db35c9c5e1141b6a9c01 (diff)
parentd3026c933cd361990a29cffb98864660a6d202ab (diff)
Merge pull request #818 from xamarin/bundle-fallbackd17-4d17-3
Fallback PropertyEditingResource in app bundle resources directory
-rw-r--r--Xamarin.PropertyEditing.Mac/HostResourceProvider.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs
index 42720a8..7beea59 100644
--- a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs
+++ b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs
@@ -17,8 +17,14 @@ namespace Xamarin.PropertyEditing.Mac
public HostResourceProvider ()
{
- var containingDir = Path.GetDirectoryName (typeof (HostResourceProvider).Assembly.Location);
- var bundlePath = Path.Combine (containingDir, "PropertyEditingResource.bundle");
+ var bundlePath = NSBundle.MainBundle.PathForResource ("PropertyEditingResource", "bundle");
+ if (!Directory.Exists (bundlePath))
+ {
+ //if the bundle resource directory is not in place we fallback into the assembly location
+ var containingDir = Path.GetDirectoryName (typeof (HostResourceProvider).Assembly.Location);
+ bundlePath = Path.Combine (containingDir, "PropertyEditingResource.bundle");
+ }
+
this.resourceBundle = new NSBundle (bundlePath);
}