From 26b8acb58c20ae06fce767e9eefb0418f4b99923 Mon Sep 17 00:00:00 2001 From: Hyrules Date: Tue, 26 Mar 2019 18:23:00 -0400 Subject: [PATCH] Code Cleanup --- HueLib2Test/Properties/AssemblyInfo.cs | 2 +- WinHue3/Build/README_TEMPLATE.txt | 3 +-- .../Functions/Application Settings/Form_AppSettings.xaml.cs | 1 + .../Functions/Application Settings/Settings/CustomSettings.cs | 2 +- WinHue3/Functions/BridgeManager/BridgeManager.cs | 2 +- WinHue3/Functions/BridgeManager/BridgeManager_Events.cs | 2 -- WinHue3/Functions/EventViewer/Form_EventLog.xaml | 2 +- WinHue3/Functions/EventViewer/Form_EventLog.xaml.cs | 3 +-- WinHue3/Functions/Rules/Creator/Form_RuleCreator.xaml.cs | 2 -- WinHue3/Functions/Scenes/View/SceneMappingViewModel.cs | 2 -- WinHue3/Functions/Sensors/Creator/Form_SensorCreator.xaml.cs | 1 - WinHue3/Functions/Sensors/Daylight/Form_Daylight.xaml.cs | 1 - WinHue3/Functions/Sensors/HueTap/HueTapConfigViewModel.cs | 1 - WinHue3/MainForm/MainFormViewModel_Methods.cs | 3 ++- WinHue3/MainForm/MainWindow.xaml.cs | 1 - WinHue3/Properties/AssemblyInfo.cs | 2 +- inno/installer_template.iss | 4 ++-- whc/Properties/AssemblyInfo.cs | 2 +- 18 files changed, 13 insertions(+), 23 deletions(-) diff --git a/HueLib2Test/Properties/AssemblyInfo.cs b/HueLib2Test/Properties/AssemblyInfo.cs index 4c45d9b1..746f9637 100644 --- a/HueLib2Test/Properties/AssemblyInfo.cs +++ b/HueLib2Test/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.626.0")] +[assembly: AssemblyVersion("1.0.628.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WinHue3/Build/README_TEMPLATE.txt b/WinHue3/Build/README_TEMPLATE.txt index fc51fdca..b987ff7e 100644 --- a/WinHue3/Build/README_TEMPLATE.txt +++ b/WinHue3/Build/README_TEMPLATE.txt @@ -2,7 +2,7 @@ /// WinHue 3 - {release} /////////////////////////////////////////////////////// -NOTE : You need Microsoft Dot Net Framework 4.7.2 for this program to work properly. +NOTE : You need Microsoft Dot Net Framework 4.5.2 for this program to work properly. You might also need Visual C++ 2010 Redistributable library. Both are available at Microsoft's website. @@ -18,7 +18,6 @@ Added: - Option to hide the floor plan tab in the application view settings. Changed: -- MOVED TO .NET FRAMEWORK 4.7.2 - Scene Creator display of sliders and values. - Replaced many Transition related up down with a practical TransitionTime Up Down. No more guessing the transition time. - Replaced some wpf toolkit up down with my own. ( bug alert ! there might be bugs in there ) diff --git a/WinHue3/Functions/Application Settings/Form_AppSettings.xaml.cs b/WinHue3/Functions/Application Settings/Form_AppSettings.xaml.cs index 4f706f8a..dda51a91 100644 --- a/WinHue3/Functions/Application Settings/Form_AppSettings.xaml.cs +++ b/WinHue3/Functions/Application Settings/Form_AppSettings.xaml.cs @@ -50,6 +50,7 @@ private void btnApply_Click(object sender, RoutedEventArgs e) WinHueSettings.settings.SlidersBehavior = _appSettingsViewModel.DefaultModel.SlidersBehavior; WinHueSettings.settings.OSRAMFix = _appSettingsViewModel.MainSettingsModel.OSRAMFix; WinHueSettings.settings.ShowFloorPlanTab = _appSettingsViewModel.ViewSettingsModel.ShowFloorPlanTab; + WinHueSettings.settings.RefreshTime = _appSettingsViewModel.MainSettingsModel.RefreshTime; string pathtostartupfile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Startup), "WinHue3.lnk"); diff --git a/WinHue3/Functions/Application Settings/Settings/CustomSettings.cs b/WinHue3/Functions/Application Settings/Settings/CustomSettings.cs index dbf04b4b..21496704 100644 --- a/WinHue3/Functions/Application Settings/Settings/CustomSettings.cs +++ b/WinHue3/Functions/Application Settings/Settings/CustomSettings.cs @@ -88,7 +88,7 @@ public CustomSettings() [DataMember(EmitDefaultValue = true)] public bool ShowFloorPlanTab { get; set; } [DataMember(EmitDefaultValue = true)] - public int RefreshTime { get; set; } + public double RefreshTime { get; set; } public override string ToString() { diff --git a/WinHue3/Functions/BridgeManager/BridgeManager.cs b/WinHue3/Functions/BridgeManager/BridgeManager.cs index 1a34358a..002088ff 100644 --- a/WinHue3/Functions/BridgeManager/BridgeManager.cs +++ b/WinHue3/Functions/BridgeManager/BridgeManager.cs @@ -27,7 +27,7 @@ private BridgeManager() { ListBridges = new ObservableCollection(); CurrentBridgeHueObjectsList = new ObservableCollection(); - _refreshTimer.Interval = new TimeSpan(0, 0, WinHueSettings.settings.RefreshTime); + _refreshTimer.Interval = new TimeSpan(0, 0, (int)WinHueSettings.settings.RefreshTime); _refreshTimer.Tick += _refreshTimer_Tick; _findlighttimer.Interval = new TimeSpan(0, 1, 0); _findlighttimer.Tick += _findlighttimer_Tick; diff --git a/WinHue3/Functions/BridgeManager/BridgeManager_Events.cs b/WinHue3/Functions/BridgeManager/BridgeManager_Events.cs index b1f4d13f..0aaa283a 100644 --- a/WinHue3/Functions/BridgeManager/BridgeManager_Events.cs +++ b/WinHue3/Functions/BridgeManager/BridgeManager_Events.cs @@ -1,8 +1,6 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using System.Windows.Input; using WinHue3.ExtensionMethods; using WinHue3.Philips_Hue.BridgeObject; diff --git a/WinHue3/Functions/EventViewer/Form_EventLog.xaml b/WinHue3/Functions/EventViewer/Form_EventLog.xaml index 6124d00f..1fe1d2a9 100644 --- a/WinHue3/Functions/EventViewer/Form_EventLog.xaml +++ b/WinHue3/Functions/EventViewer/Form_EventLog.xaml @@ -6,7 +6,7 @@ x:Name="FormEventLogger" x:Class="WinHue3.Functions.EventViewer.Form_EventLog" Title="{x:Static resx:GUI.EventLogForm_Title}" Height="457" Width="925.044" WindowStartupLocation="CenterOwner" Closing="Window_Closing" Icon="/WinHue3;component/Resources/eventlog.png" ResizeMode="CanResizeWithGrip"> - + diff --git a/WinHue3/Functions/EventViewer/Form_EventLog.xaml.cs b/WinHue3/Functions/EventViewer/Form_EventLog.xaml.cs index 186c0533..bf8080e9 100644 --- a/WinHue3/Functions/EventViewer/Form_EventLog.xaml.cs +++ b/WinHue3/Functions/EventViewer/Form_EventLog.xaml.cs @@ -1,6 +1,5 @@ using System.ComponentModel; using System.Windows; -using log4net; namespace WinHue3.Functions.EventViewer { @@ -9,7 +8,7 @@ namespace WinHue3.Functions.EventViewer /// public partial class Form_EventLog : Window { - private static readonly ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + public Form_EventLog() { InitializeComponent(); diff --git a/WinHue3/Functions/Rules/Creator/Form_RuleCreator.xaml.cs b/WinHue3/Functions/Rules/Creator/Form_RuleCreator.xaml.cs index 8cce27bd..b6755d66 100644 --- a/WinHue3/Functions/Rules/Creator/Form_RuleCreator.xaml.cs +++ b/WinHue3/Functions/Rules/Creator/Form_RuleCreator.xaml.cs @@ -3,8 +3,6 @@ using System.Windows; using WinHue3.Philips_Hue.HueObjects.RuleObject; using WinHue3.Resources; -using WinHue3.Utils; -using Bridge = WinHue3.Philips_Hue.BridgeObject.Bridge; namespace WinHue3.Functions.Rules.Creator { diff --git a/WinHue3/Functions/Scenes/View/SceneMappingViewModel.cs b/WinHue3/Functions/Scenes/View/SceneMappingViewModel.cs index 54737563..bdfa2506 100644 --- a/WinHue3/Functions/Scenes/View/SceneMappingViewModel.cs +++ b/WinHue3/Functions/Scenes/View/SceneMappingViewModel.cs @@ -3,11 +3,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Windows.Forms; using System.Windows.Input; using WinHue3.Functions.Application_Settings.Settings; using WinHue3.Functions.Scenes.Creator; -using WinHue3.Philips_Hue.BridgeObject; using WinHue3.Philips_Hue.HueObjects.LightObject; using WinHue3.Philips_Hue.HueObjects.SceneObject; using WinHue3.Utils; diff --git a/WinHue3/Functions/Sensors/Creator/Form_SensorCreator.xaml.cs b/WinHue3/Functions/Sensors/Creator/Form_SensorCreator.xaml.cs index f7db6a69..285999a6 100644 --- a/WinHue3/Functions/Sensors/Creator/Form_SensorCreator.xaml.cs +++ b/WinHue3/Functions/Sensors/Creator/Form_SensorCreator.xaml.cs @@ -1,5 +1,4 @@ using System.Windows; -using WinHue3.Philips_Hue.BridgeObject; using WinHue3.Philips_Hue.HueObjects.NewSensorsObject; using WinHue3.Resources; using WinHue3.Utils; diff --git a/WinHue3/Functions/Sensors/Daylight/Form_Daylight.xaml.cs b/WinHue3/Functions/Sensors/Daylight/Form_Daylight.xaml.cs index 25343feb..2cedb26b 100644 --- a/WinHue3/Functions/Sensors/Daylight/Form_Daylight.xaml.cs +++ b/WinHue3/Functions/Sensors/Daylight/Form_Daylight.xaml.cs @@ -1,6 +1,5 @@ using System; using System.Windows; -using WinHue3.Philips_Hue.BridgeObject; using WinHue3.Philips_Hue.HueObjects.NewSensorsObject; using WinHue3.Philips_Hue.HueObjects.NewSensorsObject.Daylight; using WinHue3.Utils; diff --git a/WinHue3/Functions/Sensors/HueTap/HueTapConfigViewModel.cs b/WinHue3/Functions/Sensors/HueTap/HueTapConfigViewModel.cs index faa690f5..5ef69e21 100644 --- a/WinHue3/Functions/Sensors/HueTap/HueTapConfigViewModel.cs +++ b/WinHue3/Functions/Sensors/HueTap/HueTapConfigViewModel.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; using System.Windows.Input; using System.Windows.Media; -using WinHue3.Philips_Hue.BridgeObject; using WinHue3.Philips_Hue.HueObjects.Common; using WinHue3.Philips_Hue.HueObjects.RuleObject; using WinHue3.Philips_Hue.HueObjects.SceneObject; diff --git a/WinHue3/MainForm/MainFormViewModel_Methods.cs b/WinHue3/MainForm/MainFormViewModel_Methods.cs index 6f76ab17..cc79e129 100644 --- a/WinHue3/MainForm/MainFormViewModel_Methods.cs +++ b/WinHue3/MainForm/MainFormViewModel_Methods.cs @@ -60,6 +60,7 @@ using Binding = System.Windows.Data.Binding; using KeyEventArgs = System.Windows.Input.KeyEventArgs; using WinHue3.ExtensionMethods; +using WinHue3.Philips_Hue.BridgeObject; namespace WinHue3.MainForm { @@ -1150,7 +1151,7 @@ private async Task SortListView() private void ShowPropertyGrid() { Form_PropertyGrid fpg = new Form_PropertyGrid {Owner = Application.Current.MainWindow}; - Binding selectedBinding = new Binding("BridgeManager.Instance.SelectedObject") {Source = this, Mode = BindingMode.TwoWay}; + Binding selectedBinding = new Binding("SelectedObject") {Source = BridgeManager.Instance, Mode = BindingMode.TwoWay}; BindingOperations.SetBinding(fpg, Form_PropertyGrid.SelectedObjectProperty, selectedBinding); fpg.Show(); } diff --git a/WinHue3/MainForm/MainWindow.xaml.cs b/WinHue3/MainForm/MainWindow.xaml.cs index 56e51bf0..7dd10c0e 100644 --- a/WinHue3/MainForm/MainWindow.xaml.cs +++ b/WinHue3/MainForm/MainWindow.xaml.cs @@ -7,7 +7,6 @@ using System.Windows.Media; using WinHue3.ExtensionMethods; using WinHue3.Functions.Application_Settings.Settings; -using WinHue3.Functions.EventViewer; using WinHue3.Philips_Hue; using WinHue3.Philips_Hue.HueObjects.LightObject; using WinHue3.Philips_Hue.HueObjects.ResourceLinkObject; diff --git a/WinHue3/Properties/AssemblyInfo.cs b/WinHue3/Properties/AssemblyInfo.cs index adf0020d..ebeead25 100644 --- a/WinHue3/Properties/AssemblyInfo.cs +++ b/WinHue3/Properties/AssemblyInfo.cs @@ -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.4292.0")] +[assembly: AssemblyVersion("3.0.4301.0")] //[assembly: AssemblyFileVersion("3.0.*")] [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)] \ No newline at end of file diff --git a/inno/installer_template.iss b/inno/installer_template.iss index 1db67760..2806c58e 100644 --- a/inno/installer_template.iss +++ b/inno/installer_template.iss @@ -152,8 +152,8 @@ end; function InitializeSetup(): Boolean; begin - if not IsDotNetDetected('v4.7.2', 0) then begin - MsgBox('WinHue requires Microsoft .NET Framework 4.7.2.'#13#13 + if not IsDotNetDetected('v4.5.2', 0) then begin + MsgBox('WinHue requires Microsoft .NET Framework 4.5.2.'#13#13 'Please use Windows Update to install this version,'#13 'and then re-run the WinHue setup program.', mbInformation, MB_OK); result := false; diff --git a/whc/Properties/AssemblyInfo.cs b/whc/Properties/AssemblyInfo.cs index 919ebf4e..e906998e 100644 --- a/whc/Properties/AssemblyInfo.cs +++ b/whc/Properties/AssemblyInfo.cs @@ -30,5 +30,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.490.0")] +[assembly: AssemblyVersion("1.0.492.0")] [assembly: AssemblyFileVersion("1.0.0.0")]