From ca09588390417558a9a1747b750ab0720e8f9647 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 9 Aug 2014 01:27:53 -0700 Subject: [PATCH] Fixed: Remove GDI+ dependency with embedded resource --- .../Notifications/Growl/GrowlService.cs | 14 +- src/NzbDrone.Core/NzbDrone.Core.csproj | 12 -- .../Properties/Resources.Designer.cs | 73 ----------- src/NzbDrone.Core/Properties/Resources.resx | 124 ------------------ src/NzbDrone.Core/Resources/64.png | Bin 3582 -> 0 bytes 5 files changed, 5 insertions(+), 218 deletions(-) delete mode 100644 src/NzbDrone.Core/Properties/Resources.Designer.cs delete mode 100644 src/NzbDrone.Core/Properties/Resources.resx delete mode 100644 src/NzbDrone.Core/Resources/64.png diff --git a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs index b14991721..c7c943c5b 100644 --- a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs +++ b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs @@ -2,15 +2,11 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -using System.Drawing; -using System.Drawing.Imaging; using FluentValidation.Results; using Growl.CoreLibrary; using Growl.Connector; using NLog; -using NzbDrone.Common.Instrumentation; using GrowlNotification = Growl.Connector.Notification; -using System.Reflection; using System.IO; namespace NzbDrone.Core.Notifications.Growl @@ -31,7 +27,7 @@ namespace NzbDrone.Core.Notifications.Growl private class GrowlRequestState { private AutoResetEvent _autoEvent = new AutoResetEvent(false); - private bool _isError = false; + private bool _isError; private int _code; private string _description; @@ -76,10 +72,10 @@ namespace NzbDrone.Core.Notifications.Growl _logger = logger; _notificationTypes = GetNotificationTypes(); - var icon = Properties.Resources.Icon64; - var stream = new MemoryStream(); - icon.Save(stream, ImageFormat.Bmp); - _growlApplication.Icon = new BinaryData(stream.ToArray()); + var iconPath = Path.Combine("UI", "Content", "Images", "logos", "64.png"); + var bytes = File.ReadAllBytes(iconPath); + + _growlApplication.Icon = new BinaryData(bytes); } private GrowlConnector GetGrowlConnector(string hostname, int port, string password) diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 399c6735a..8dbf6f83e 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -663,11 +663,6 @@ - - True - True - Resources.resx - @@ -802,13 +797,6 @@ Always - - - - - ResXFileCodeGenerator - Resources.Designer.cs - diff --git a/src/NzbDrone.Core/Properties/Resources.Designer.cs b/src/NzbDrone.Core/Properties/Resources.Designer.cs deleted file mode 100644 index a995b6ddd..000000000 --- a/src/NzbDrone.Core/Properties/Resources.Designer.cs +++ /dev/null @@ -1,73 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.18444 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NzbDrone.Core.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NzbDrone.Core.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - internal static System.Drawing.Bitmap Icon64 { - get { - object obj = ResourceManager.GetObject("Icon64", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/src/NzbDrone.Core/Properties/Resources.resx b/src/NzbDrone.Core/Properties/Resources.resx deleted file mode 100644 index d22523afe..000000000 --- a/src/NzbDrone.Core/Properties/Resources.resx +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/src/NzbDrone.Core/Resources/64.png b/src/NzbDrone.Core/Resources/64.png deleted file mode 100644 index 33387d7f9372b0951d676da70a366cf594312de4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3582 zcmVTbCem6VE_Do_KvSwY?P+AWiK0-gy5 zMMX4G1QbvsB18n#z-)ib-~awI3@|hQpuDQC>FNLP;~o9p>(}qsP%A@aWo0n?LGfc{ zgw%}xo+e(;kbZMm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