Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Commit

Permalink
Tentative fix for the lag.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyrules committed Mar 23, 2019
1 parent 59d43da commit 5daaad9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 24 deletions.
1 change: 0 additions & 1 deletion WinHue3/MainForm/MainFormViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public MainFormViewModel()
_ledTimer.Tick += _ledTimer_Tick;
_lhk = new List<HotKeyHandle>();
_listBridgeObjects = new ObservableCollection<IHueObject>();
_listBridges = new ObservableCollection<Bridge>();
_findlighttimer.Interval = new TimeSpan(0, 1, 0);
_findlighttimer.Tick += _findlighttimer_Tick;
_findsensortimer.Interval = new TimeSpan(0, 1, 0);
Expand Down
15 changes: 0 additions & 15 deletions WinHue3/MainForm/MainFormViewModel_Properties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ namespace WinHue3.MainForm
public partial class MainFormViewModel : ValidatableBindableBase
{
private Form_EventLog _eventlogform;
private ObservableCollection<Bridge> _listBridges;
private ObservableCollection<IGroup> _listgroups;
private IHueObject _selectedObject;
private ushort? _sliderTT;
private bool _visibleTabs = true;
private IBaseProperties _newstate;
private int _sensorStatus;
private bool _sensorFlag;
Expand Down Expand Up @@ -156,18 +153,6 @@ public Visibility UpdateAvailable
}
}

public bool VisibleTabs
{
get => _visibleTabs;
set => SetProperty(ref _visibleTabs, value);
}

public ObservableCollection<IGroup> ListGroups
{
get => _listgroups;
set => SetProperty(ref _listgroups, value);
}

public ObservableCollection<Floor> ListFloorPlans
{
get { return _listFloorPlans; }
Expand Down
2 changes: 1 addition & 1 deletion WinHue3/MainForm/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@
behaviors:OnDoubleClickBehavior.IgnoreDblClick_CanExecute="True"
behaviors:KeyUpBehavior.Command="{Binding DeleteObjectCommand}"
ItemsSource="{Binding ListBridgeObjects}"
Margin="0,0,0,0.333">
Margin="0,0,0,0.333" MaxHeight="8000">

<ListView.Resources>
<DataTemplate x:Key="HueIcon" DataType="common:IHueObject">
Expand Down
10 changes: 6 additions & 4 deletions WinHue3/Philips Hue/Communication/Serializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ public static class Serializer
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private static readonly JsonSerializerSettings jss = new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, StringEscapeHandling = StringEscapeHandling.Default };

private static readonly HueCreateDataContractResolver hcr = new HueCreateDataContractResolver();
private static readonly HueModifyDataContractResolver hmc = new HueModifyDataContractResolver();
private static readonly DefaultContractResolver dcr = new DefaultContractResolver();

public static object DeserializeToObject(string json, Type objecttype)
{
Expand Down Expand Up @@ -40,7 +42,7 @@ public static object DeserializeToObject(string json, Type objecttype)

public static string SerializeJsonObject(object obj)
{
jss.ContractResolver = new DefaultContractResolver();
jss.ContractResolver = dcr;
try
{
if (obj != null)
Expand All @@ -61,7 +63,7 @@ public static string SerializeJsonObject(object obj)
/// <returns>JSON String</returns>
public static string CreateJsonObject(object obj)
{
jss.ContractResolver = new HueCreateDataContractResolver();
jss.ContractResolver = hcr;
try
{
if (obj != null)
Expand All @@ -83,7 +85,7 @@ public static string CreateJsonObject(object obj)
/// <returns></returns>
public static string ModifyJsonObject(object obj)
{
jss.ContractResolver = new HueModifyDataContractResolver();
jss.ContractResolver = hmc;
try
{
if (obj != null)
Expand Down
2 changes: 1 addition & 1 deletion WinHue3/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
// en utilisant '*', comme indiqué ci-dessous :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.4236.0")]
[assembly: AssemblyVersion("3.0.4241.0")]
//[assembly: AssemblyFileVersion("3.0.*")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
7 changes: 5 additions & 2 deletions WinHue3_1.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProjectSection
EndProject
Global
GlobalSection(Performance) = preSolution
HasPerformanceSessions = true
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -56,8 +59,8 @@ Global
{5FC27AAC-E748-41BE-81F0-D2842D9925B4} = {383AF157-5558-4EE8-8B8D-9A904C4F5FB0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
BuildVersion_StartDate = 2000/1/1
SolutionGuid = {F7AF3748-36F5-46A1-AFE9-F9272BC23765}
VisualSVNWorkingCopyRoot = .
SolutionGuid = {F7AF3748-36F5-46A1-AFE9-F9272BC23765}
BuildVersion_StartDate = 2000/1/1
EndGlobalSection
EndGlobal

0 comments on commit 5daaad9

Please sign in to comment.