Skip to content

Commit 9676034

Browse files
authored
Release/3.0.0 (#120)
* set version to 3.0.7 * set relative path to images * update readme.md * remove RegistryTool.cs * code cleanup
1 parent 04dddb2 commit 9676034

20 files changed

+377
-454
lines changed

Captures/en/taskbar.jpg

-33.1 KB
Loading

NeedABreak/AboutBoxWindow.xaml.cs

-12
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,9 @@ You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919
using MahApps.Metro.Controls;
20-
using System;
21-
using System.Collections.Generic;
2220
using System.Diagnostics;
23-
using System.Linq;
2421
using System.Reflection;
25-
using System.Text;
26-
using System.Threading.Tasks;
2722
using System.Windows;
28-
using System.Windows.Controls;
29-
using System.Windows.Data;
30-
using System.Windows.Documents;
31-
using System.Windows.Input;
32-
using System.Windows.Media;
33-
using System.Windows.Media.Imaging;
34-
using System.Windows.Shapes;
3523

3624
namespace NeedABreak
3725
{

NeedABreak/App.xaml.cs

+2-7
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,10 @@ You should have received a copy of the GNU General Public License
2020
using NeedABreak.Properties;
2121
using NeedABreak.Utils;
2222
using System;
23-
using System.Collections.Generic;
2423
using System.Configuration;
25-
using System.Data;
26-
using System.Linq;
27-
using System.Runtime.InteropServices;
2824
using System.Threading.Tasks;
2925
using System.Timers;
3026
using System.Windows;
31-
using System.Windows.Threading;
3227

3328
namespace NeedABreak
3429
{
@@ -88,7 +83,7 @@ static App()
8883
_cumulativeScreenTime += interruptionDuration;
8984
}
9085
}
91-
86+
9287
_dayStart = DateTime.Today;
9388
_startShowingScreen = DateTime.Now;
9489

@@ -283,7 +278,7 @@ private static void SystemEvents_SessionSwitch(object sender, Microsoft.Win32.Se
283278
if (e.Reason == Microsoft.Win32.SessionSwitchReason.SessionUnlock)
284279
{
285280
Logger.Debug("SessionUnlock");
286-
281+
287282
Current.Dispatcher.BeginInvoke(() =>
288283
{
289284
var mainWindow = GetMainWindow();

NeedABreak/BorderSelectedAdorner.cs

+4-9
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
19-
using System;
20-
using System.Collections.Generic;
21-
using System.Linq;
22-
using System.Text;
23-
using System.Threading.Tasks;
2419
using System.Windows;
2520
using System.Windows.Documents;
2621
using System.Windows.Media;
@@ -42,7 +37,7 @@ protected override void OnRender(DrawingContext drawingContext)
4237
var pen = new Pen(brush, 6);
4338
var whitePen = new Pen(Brushes.White, 8);
4439
drawingContext.DrawRectangle(Brushes.Transparent, pen, adornedElementRect);
45-
var miniRect = new Rect(adornedElementRect.Right - 50, adornedElementRect.Bottom - 50,
40+
var miniRect = new Rect(adornedElementRect.Right - 50, adornedElementRect.Bottom - 50,
4641
50, 50);
4742
drawingContext.DrawRectangle(brush, pen, miniRect);
4843
var p1 = new Point(adornedElementRect.Right - 40, adornedElementRect.Bottom - 25);
@@ -51,8 +46,8 @@ protected override void OnRender(DrawingContext drawingContext)
5146
var p3 = new Point(p2.X + 20, p2.Y - 20);
5247
drawingContext.DrawLine(whitePen, p1, p2);
5348
drawingContext.DrawLine(whitePen, p4, p3);
54-
}
55-
56-
49+
}
50+
51+
5752
}
5853
}

NeedABreak/Converters/BooleanToOppositeValueConverter.cs

-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919
using System;
20-
using System.Collections.Generic;
2120
using System.Globalization;
22-
using System.Linq;
23-
using System.Text;
24-
using System.Threading.Tasks;
2521
using System.Windows.Data;
2622

2723
namespace NeedABreak.Converters

NeedABreak/Converters/BooleanToVisibilityConverter.cs

-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
using System;
2-
using System.Collections.Generic;
32
using System.Globalization;
4-
using System.Linq;
5-
using System.Text;
6-
using System.Threading.Tasks;
73
using System.Windows;
84
using System.Windows.Data;
95

NeedABreak/Enums/SuspensionCause.cs

-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
19-
using System;
20-
using System.Collections.Generic;
21-
using System.Linq;
22-
using System.Text;
23-
using System.Threading;
24-
using System.Threading.Tasks;
25-
2619
namespace NeedABreak
2720
{
2821
public enum SuspensionCause

NeedABreak/Enums/UserNotificationState.cs

-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
19-
using System;
20-
using System.Collections.Generic;
21-
using System.Linq;
22-
using System.Text;
23-
using System.Threading.Tasks;
24-
2519
namespace NeedABreak.Utils
2620
{
2721
public enum UserNotificationState

NeedABreak/Extensions/TimeSpanExtensions.cs

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
62

73
namespace NeedABreak.Extensions
84
{

NeedABreak/MainWindow.xaml.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License
1717
along with this program. If not, see <https://www.gnu.org/licenses/>.
1818
*/
1919
using MahApps.Metro.Controls;
20-
using Microsoft.Win32;
2120
using NeedABreak.Extensions;
2221
using NeedABreak.Utils;
2322
using System;
@@ -109,9 +108,9 @@ private async void LaunchOnStartupMenuItem_Unchecked(object sender, RoutedEventA
109108
}
110109

111110
private async void LaunchOnStartupMenuItem_Checked(object sender, RoutedEventArgs e)
112-
{
111+
{
113112
StartupTask startupTask = await StartupTask.GetAsync("NeedABreak.StartupTask");
114-
113+
115114
switch (startupTask.State)
116115
{
117116
case StartupTaskState.Disabled:
@@ -387,7 +386,7 @@ private void AutomaticSuspensionMenuItem_Unchecked(object sender, RoutedEventArg
387386

388387
if (App.IsSuspended && App.SuspensionCause == SuspensionCause.Automatic)
389388
{
390-
App.Resume();
389+
App.Resume();
391390
}
392391
}
393392

0 commit comments

Comments
 (0)