Readded Growl logo via embedded binary blob.

pull/6/head
Taloth Saldono 10 years ago committed by Mark McDowall
parent a62cd042de
commit d1a8cd2a84

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

@ -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;
}
}
}

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

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

Loading…
Cancel
Save