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 17:39:51 +0300
committerJose Medrano <josmed@microsoft.com>2022-06-14 18:57:25 +0300
commitd3026c933cd361990a29cffb98864660a6d202ab (patch)
treec1dc596e25f9767581deaf178cc509d2bdb7f3c5
parentfacd67f222ff326c28d2db35c9c5e1141b6a9c01 (diff)
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);
}