Readded Growl logo via embedded binary blob.

This commit is contained in:
Taloth Saldono 2014-08-09 14:58:04 +02:00 committed by Mark McDowall
parent a62cd042de
commit d1a8cd2a84
4 changed files with 43 additions and 14 deletions

View File

@ -138,6 +138,7 @@
<Compile Include="Properties\SharedAssemblyInfo.cs" />
<Compile Include="RateGate.cs" />
<Compile Include="Reflection\ReflectionExtensions.cs" />
<Compile Include="ResourceExtensions.cs" />
<Compile Include="Security\IgnoreCertErrorPolicy.cs" />
<Compile Include="Serializer\IntConverter.cs" />
<Compile Include="Serializer\Json.cs" />

View File

@ -0,0 +1,28 @@
using NzbDrone.Common.EnsureThat;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
namespace NzbDrone.Common
{
public static class ResourceExtensions
{
public static Byte[] GetManifestResourceBytes(this Assembly assembly, String name)
{
var stream = assembly.GetManifestResourceStream(name);
var result = new Byte[stream.Length];
var read = stream.Read(result, 0, result.Length);
if (read != result.Length)
{
throw new EndOfStreamException("Reached end of stream before reading enough bytes.");
}
return result;
}
}
}

View File

@ -1,13 +1,14 @@
using System;
using FluentValidation.Results;
using Growl.Connector;
using Growl.CoreLibrary;
using GrowlNotification = Growl.Connector.Notification;
using NLog;
using NzbDrone.Common;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using FluentValidation.Results;
using Growl.CoreLibrary;
using Growl.Connector;
using NLog;
using GrowlNotification = Growl.Connector.Notification;
using System.IO;
namespace NzbDrone.Core.Notifications.Growl
{
@ -72,9 +73,9 @@ namespace NzbDrone.Core.Notifications.Growl
_logger = logger;
_notificationTypes = GetNotificationTypes();
// var bytes = File.ReadAllBytes("64.png");
//
// _growlApplication.Icon = new BinaryData(bytes);
var logo = typeof(GrowlService).Assembly.GetManifestResourceBytes("NzbDrone.Core.Resources.Logo.64.png");
_growlApplication.Icon = new BinaryData(logo);
}
private GrowlConnector GetGrowlConnector(string hostname, int port, string password)

View File

@ -794,10 +794,9 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="..\..\Logo\64.png">
<Link>64.png</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<EmbeddedResource Include="..\..\Logo\64.png">
<Link>Resources\Logo\64.png</Link>
</EmbeddedResource>
<Content Include="MediaInfo.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>