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

Commit

Permalink
Code Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyrules committed Mar 26, 2019
1 parent 60d6ce4 commit 26b8acb
Show file tree
Hide file tree
Showing 18 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion HueLib2Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
3 changes: 1 addition & 2 deletions WinHue3/Build/README_TEMPLATE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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 )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion WinHue3/Functions/BridgeManager/BridgeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private BridgeManager()
{
ListBridges = new ObservableCollection<Bridge>();
CurrentBridgeHueObjectsList = new ObservableCollection<IHueObject>();
_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;
Expand Down
2 changes: 0 additions & 2 deletions WinHue3/Functions/BridgeManager/BridgeManager_Events.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion WinHue3/Functions/EventViewer/Form_EventLog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<Grid>
<DataGrid x:Name="DataGrid" AutoGenerateColumns="False" ItemsSource="{Binding Source={x:Static eventViewer:EventLog.Instance}, Path=ListLogs}" CanUserReorderColumns="False" CanUserResizeRows="False" HorizontalGridLinesBrush="Gray" VerticalGridLinesBrush="Gray" GridLinesVisibility="Horizontal" Margin="0,0,0,19" EnableColumnVirtualization="True" ScrollViewer.CanContentScroll="False">
<DataGrid x:Name="DataGrid" AutoGenerateColumns="False" ItemsSource="{Binding Source={x:Static eventViewer:EventLog.Instance}, Path=ListLogs}" CanUserReorderColumns="False" CanUserResizeRows="False" HorizontalGridLinesBrush="Gray" VerticalGridLinesBrush="Gray" GridLinesVisibility="Horizontal" Margin="0,0,0,19" >
<DataGrid.Columns>
<DataGridTemplateColumn MinWidth="100" Header="Timestamp">
<DataGridTemplateColumn.CellTemplate>
Expand Down
3 changes: 1 addition & 2 deletions WinHue3/Functions/EventViewer/Form_EventLog.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System.ComponentModel;
using System.Windows;
using log4net;

namespace WinHue3.Functions.EventViewer
{
Expand All @@ -9,7 +8,7 @@ namespace WinHue3.Functions.EventViewer
/// </summary>
public partial class Form_EventLog : Window
{
private static readonly ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

public Form_EventLog()
{
InitializeComponent();
Expand Down
2 changes: 0 additions & 2 deletions WinHue3/Functions/Rules/Creator/Form_RuleCreator.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 0 additions & 2 deletions WinHue3/Functions/Scenes/View/SceneMappingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Windows;
using WinHue3.Philips_Hue.BridgeObject;
using WinHue3.Philips_Hue.HueObjects.NewSensorsObject;
using WinHue3.Resources;
using WinHue3.Utils;
Expand Down
1 change: 0 additions & 1 deletion WinHue3/Functions/Sensors/Daylight/Form_Daylight.xaml.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 0 additions & 1 deletion WinHue3/Functions/Sensors/HueTap/HueTapConfigViewModel.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
3 changes: 2 additions & 1 deletion WinHue3/MainForm/MainFormViewModel_Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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();
}
Expand Down
1 change: 0 additions & 1 deletion WinHue3/MainForm/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
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.4292.0")]
[assembly: AssemblyVersion("3.0.4301.0")]
//[assembly: AssemblyFileVersion("3.0.*")]
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", Watch = true)]
4 changes: 2 additions & 2 deletions inno/installer_template.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion whc/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 26b8acb

Please sign in to comment.