Skip to content

Commit

Permalink
Updating libraries, assign error on Effects.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianLima committed Jan 15, 2018
1 parent 83d527f commit 6fa0e44
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 42 deletions.
13 changes: 9 additions & 4 deletions HueHue/Helpers/ColorsJsonConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace HueHue.Helpers
{
public class ColorsJsonConverter: JsonConverter
public class ColorsJsonConverter : JsonConverter
{
private readonly Type[] _types;

Expand All @@ -30,13 +30,18 @@ public override bool CanConvert(Type objectType)
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
JObject jo = JObject.Load(reader);
return new Color(jo["A"].Value<byte>(), jo["R"].Value<byte>(), jo["G"].Value<byte>(), jo["B"].Value<byte>());

Byte.TryParse(jo["A"].Value<string>(), out byte a);
Byte.TryParse(jo["R"].Value<string>(), out byte r);
Byte.TryParse(jo["G"].Value<string>(), out byte g);
Byte.TryParse(jo["B"].Value<string>(), out byte b);

return new Color(a, r, g, b);
}

public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{

throw new NotImplementedException(); // won't be called because CanWrite returns false
throw new NotImplementedException(); //Isn't needed
}
}
}
2 changes: 1 addition & 1 deletion HueHue/Helpers/Effects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ public static void ColorCycle()
// }
//}

Colors[0].AddHue(1);
Colors[0] = Colors[0].AddHue(1);

//Fill the strip with the color
for (int i = 0; i < LEDs.Count; i++)
Expand Down
52 changes: 29 additions & 23 deletions HueHue/HueHue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,37 +68,43 @@
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Brushes, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Brushes.0.0.1.18\lib\net45\RGB.NET.Brushes.dll</HintPath>
<HintPath>..\packages\RGB.NET.Brushes.0.0.1.23\lib\net45\RGB.NET.Brushes.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Core, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Core.0.0.1.18\lib\net45\RGB.NET.Core.dll</HintPath>
<HintPath>..\packages\RGB.NET.Core.0.0.1.23\lib\net45\RGB.NET.Core.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Decorators, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Decorators.0.0.1.18\lib\net45\RGB.NET.Decorators.dll</HintPath>
<HintPath>..\packages\RGB.NET.Decorators.0.0.1.23\lib\net45\RGB.NET.Decorators.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Asus, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Asus.0.0.1.18\lib\net45\RGB.NET.Devices.Asus.dll</HintPath>
<HintPath>..\packages\RGB.NET.Devices.Asus.0.0.1.23\lib\net45\RGB.NET.Devices.Asus.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.CoolerMaster, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.18\lib\net45\RGB.NET.Devices.CoolerMaster.dll</HintPath>
<HintPath>..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.23\lib\net45\RGB.NET.Devices.CoolerMaster.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Corsair, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.0.1.18\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
<HintPath>..\packages\RGB.NET.Devices.Corsair.0.0.1.23\lib\net45\RGB.NET.Devices.Corsair.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Logitech, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Logitech.0.0.1.18\lib\net45\RGB.NET.Devices.Logitech.dll</HintPath>
<HintPath>..\packages\RGB.NET.Devices.Logitech.0.0.1.23\lib\net45\RGB.NET.Devices.Logitech.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Msi, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Msi.0.0.1.18\lib\net45\RGB.NET.Devices.Msi.dll</HintPath>
<HintPath>..\packages\RGB.NET.Devices.Msi.0.0.1.23\lib\net45\RGB.NET.Devices.Msi.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Novation, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Novation.0.0.1.18\lib\net45\RGB.NET.Devices.Novation.dll</HintPath>
<HintPath>..\packages\RGB.NET.Devices.Novation.0.0.1.23\lib\net45\RGB.NET.Devices.Novation.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Devices.Razer, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Devices.Razer.0.0.1.18\lib\net45\RGB.NET.Devices.Razer.dll</HintPath>
<HintPath>..\packages\RGB.NET.Devices.Razer.0.0.1.23\lib\net45\RGB.NET.Devices.Razer.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Groups, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Groups.0.0.1.18\lib\net45\RGB.NET.Groups.dll</HintPath>
<HintPath>..\packages\RGB.NET.Groups.0.0.1.23\lib\net45\RGB.NET.Groups.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Input, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Input.0.0.1.23\lib\net45\RGB.NET.Input.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.Input.Corsair, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.Input.Corsair.0.0.1.23\lib\net45\RGB.NET.Input.Corsair.dll</HintPath>
</Reference>
<Reference Include="RGB.NET.WPF, Version=0.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\RGB.NET.WPF.0.0.1.15\lib\net45\RGB.NET.WPF.dll</HintPath>
Expand Down Expand Up @@ -346,23 +352,23 @@
<Content Include="Resources\ColorTools.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\RGB.NET.Devices.Asus.0.0.1.18\build\net45\RGB.NET.Devices.Asus.targets" Condition="Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.18\build\net45\RGB.NET.Devices.Asus.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.18\build\net45\RGB.NET.Devices.Asus.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Asus.0.0.1.18\build\net45\RGB.NET.Devices.Asus.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.18\build\net45\RGB.NET.Devices.CoolerMaster.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.18\build\net45\RGB.NET.Devices.CoolerMaster.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.18\build\net45\RGB.NET.Devices.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Corsair.0.0.1.18\build\net45\RGB.NET.Devices.Corsair.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.18\build\net45\RGB.NET.Devices.Logitech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Logitech.0.0.1.18\build\net45\RGB.NET.Devices.Logitech.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.18\build\net45\RGB.NET.Devices.Msi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Msi.0.0.1.18\build\net45\RGB.NET.Devices.Msi.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.18\build\net45\RGB.NET.Devices.Razer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Razer.0.0.1.18\build\net45\RGB.NET.Devices.Razer.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.23\build\net45\RGB.NET.Devices.Corsair.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Corsair.0.0.1.23\build\net45\RGB.NET.Devices.Corsair.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.23\build\net45\RGB.NET.Devices.Razer.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Razer.0.0.1.23\build\net45\RGB.NET.Devices.Razer.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.23\build\net45\RGB.NET.Devices.Asus.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Asus.0.0.1.23\build\net45\RGB.NET.Devices.Asus.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.23\build\net45\RGB.NET.Devices.Logitech.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Logitech.0.0.1.23\build\net45\RGB.NET.Devices.Logitech.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.23\build\net45\RGB.NET.Devices.CoolerMaster.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.23\build\net45\RGB.NET.Devices.CoolerMaster.targets'))" />
<Error Condition="!Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.23\build\net45\RGB.NET.Devices.Msi.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\RGB.NET.Devices.Msi.0.0.1.23\build\net45\RGB.NET.Devices.Msi.targets'))" />
</Target>
<Import Project="..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.18\build\net45\RGB.NET.Devices.CoolerMaster.targets" Condition="Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.18\build\net45\RGB.NET.Devices.CoolerMaster.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Corsair.0.0.1.18\build\net45\RGB.NET.Devices.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.18\build\net45\RGB.NET.Devices.Corsair.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Logitech.0.0.1.18\build\net45\RGB.NET.Devices.Logitech.targets" Condition="Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.18\build\net45\RGB.NET.Devices.Logitech.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Msi.0.0.1.18\build\net45\RGB.NET.Devices.Msi.targets" Condition="Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.18\build\net45\RGB.NET.Devices.Msi.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Razer.0.0.1.18\build\net45\RGB.NET.Devices.Razer.targets" Condition="Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.18\build\net45\RGB.NET.Devices.Razer.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Corsair.0.0.1.23\build\net45\RGB.NET.Devices.Corsair.targets" Condition="Exists('..\packages\RGB.NET.Devices.Corsair.0.0.1.23\build\net45\RGB.NET.Devices.Corsair.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Razer.0.0.1.23\build\net45\RGB.NET.Devices.Razer.targets" Condition="Exists('..\packages\RGB.NET.Devices.Razer.0.0.1.23\build\net45\RGB.NET.Devices.Razer.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Asus.0.0.1.23\build\net45\RGB.NET.Devices.Asus.targets" Condition="Exists('..\packages\RGB.NET.Devices.Asus.0.0.1.23\build\net45\RGB.NET.Devices.Asus.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Logitech.0.0.1.23\build\net45\RGB.NET.Devices.Logitech.targets" Condition="Exists('..\packages\RGB.NET.Devices.Logitech.0.0.1.23\build\net45\RGB.NET.Devices.Logitech.targets')" />
<Import Project="..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.23\build\net45\RGB.NET.Devices.CoolerMaster.targets" Condition="Exists('..\packages\RGB.NET.Devices.CoolerMaster.0.0.1.23\build\net45\RGB.NET.Devices.CoolerMaster.targets')" />
<Import Project="..\packages\RGB.NET.Devices.Msi.0.0.1.23\build\net45\RGB.NET.Devices.Msi.targets" Condition="Exists('..\packages\RGB.NET.Devices.Msi.0.0.1.23\build\net45\RGB.NET.Devices.Msi.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
30 changes: 16 additions & 14 deletions HueHue/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@
<package id="MaterialDesignThemes" version="2.3.1.953" targetFramework="net46" />
<package id="Newtonsoft.Json" version="10.0.3" targetFramework="net46" />
<package id="NLog" version="4.4.12" targetFramework="net46" />
<package id="RGB.NET" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Brushes" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Core" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Decorators" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices.Asus" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices.CoolerMaster" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices.Corsair" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices.Logitech" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices.Msi" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices.Novation" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Devices.Razer" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Groups" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET.Presets" version="0.0.1.18" targetFramework="net46" />
<package id="RGB.NET" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Brushes" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Core" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Decorators" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices.Asus" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices.CoolerMaster" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices.Corsair" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices.Logitech" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices.Msi" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices.Novation" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Devices.Razer" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Groups" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Input" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Input.Corsair" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.Presets" version="0.0.1.23" targetFramework="net46" />
<package id="RGB.NET.WPF" version="0.0.1.15" targetFramework="net46" />
<package id="Sanford.Multimedia.Midi" version="6.4.1" targetFramework="net46" />
<package id="SharpDX" version="4.0.1" targetFramework="net46" />
Expand Down

0 comments on commit 6fa0e44

Please sign in to comment.