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:
Diffstat (limited to 'Xamarin.PropertyEditing.Mac/HostResourceProvider.cs')
-rw-r--r--Xamarin.PropertyEditing.Mac/HostResourceProvider.cs12
1 files changed, 11 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs
index 8596b47..bd2b509 100644
--- a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs
+++ b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs
@@ -1,4 +1,5 @@
using System;
+using System.IO;
using AppKit;
using Foundation;
@@ -13,6 +14,15 @@ namespace Xamarin.PropertyEditing.Mac
set;
}
+ private readonly NSBundle resourceBundle;
+
+ public HostResourceProvider ()
+ {
+ var containingDir = Path.GetDirectoryName (typeof (HostResourceProvider).Assembly.Location);
+ var bundlePath = Path.Combine (containingDir, "PropertyEditingResource.bundle");
+ this.resourceBundle = new NSBundle (bundlePath);
+ }
+
public virtual NSAppearance GetVibrantAppearance (NSAppearance appearance)
{
if (appearance == null)
@@ -42,7 +52,7 @@ namespace Xamarin.PropertyEditing.Mac
name += "~sel";
}
- return NSImage.ImageNamed (name);
+ return this.resourceBundle.ImageForResource (name);
}
public virtual NSFont GetNamedFont (string name, nfloat fontSize)