Skip to content

Commit 7ca5362

Browse files
committed
formatting, and version to 1.3
1 parent d60ea34 commit 7ca5362

3 files changed

Lines changed: 19 additions & 41 deletions

File tree

Program.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ static void Main() {
9090
Application.Run(context);
9191
}
9292

93-
public AppContext()
94-
{
93+
public AppContext() {
9594
this.components = new Container();
9695
this.timer = new Timer(components);
9796
timer.Tick += new EventHandler(timer_Tick);
@@ -125,8 +124,7 @@ public AppContext()
125124
}
126125
}
127126

128-
void SetIsLightTheme()
129-
{
127+
void SetIsLightTheme() {
130128
var settings = new vm.UISettings();
131129
Windows.UI.Color color = settings.GetColorValue(vm.UIColorType.Accent);
132130
var foreground = settings.GetColorValue(vm.UIColorType.Foreground);
@@ -141,14 +139,12 @@ void SetIsLightTheme()
141139
isLightTheme = true;
142140
}
143141

144-
private static String HexConverter(Color c)
145-
{
142+
private static String HexConverter(Color c) {
146143
return "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
147144
}
148145

149146
private void setIcons() {
150-
switch (Settings.Default.Icon)
151-
{
147+
switch (Settings.Default.Icon) {
152148
case "Mug":
153149
if (isLightTheme){
154150
this.offIcon = new Icon(
@@ -279,6 +275,7 @@ void showSettings() {
279275

280276
private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e) {
281277
setContextMenu();
278+
SetIsLightTheme();
282279
setIcons();
283280

284281
if (isActivated)

Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.2.0.0")]
36-
[assembly: AssemblyFileVersion("1.2.0.0")]
35+
[assembly: AssemblyVersion("1.3.0.0")]
36+
[assembly: AssemblyFileVersion("1.3.0.0")]

SettingsForm.cs

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
using System;
22
using System.ComponentModel;
33
using System.Diagnostics;
4-
using System.Drawing;
5-
using System.IO;
64
using System.Linq;
7-
using System.Reflection;
85
using System.Windows.Forms;
96
using Caffeinated.Properties;
10-
using Microsoft.Win32;
117
using Windows.ApplicationModel;
12-
using vm = Windows.UI.ViewManagement;
138

149
namespace Caffeinated {
1510
public partial class SettingsForm : BaseForm {
@@ -40,8 +35,7 @@ public SettingsForm() : base() {
4035
}
4136

4237
private void setRadioButtons() {
43-
switch (Settings.Default.Icon)
44-
{
38+
switch (Settings.Default.Icon) {
4539
case "Mug":
4640
mugRDBTN.Checked = true;
4741
break;
@@ -54,8 +48,7 @@ private void setRadioButtons() {
5448
}
5549
}
5650

57-
private void DeleteMI_Click(object sender, EventArgs e)
58-
{
51+
private void DeleteMI_Click(object sender, EventArgs e) {
5952
Duration durationToDelete = DefaultDurationBox.SelectedItem as Duration;
6053

6154
DialogResult result = MessageBox.Show(
@@ -64,8 +57,7 @@ private void DeleteMI_Click(object sender, EventArgs e)
6457
MessageBoxButtons.YesNo
6558
);
6659

67-
switch (result)
68-
{
60+
switch (result) {
6961
case DialogResult.None:
7062
break;
7163
case DialogResult.OK:
@@ -94,8 +86,7 @@ private async void setStartupCheckBox() {
9486
StartupTask startupTask = await StartupTask.GetAsync("StartCaffeinated");
9587
Debug.WriteLine("Startup is " + startupTask.State.ToString());
9688

97-
switch (startupTask.State)
98-
{
89+
switch (startupTask.State) {
9990
case StartupTaskState.Disabled:
10091
// Task is disabled but can be enabled.
10192
StartupChkBox.Checked = false;
@@ -122,10 +113,7 @@ private void cancelBtn_Click(object sender, EventArgs e) {
122113
this.Close();
123114
}
124115

125-
private void DefaultDurationBox_SelectedIndexChanged(
126-
object sender,
127-
EventArgs e
128-
) {
116+
private void DefaultDurationBox_SelectedIndexChanged(object sender,EventArgs e) {
129117
var item = DefaultDurationBox.SelectedItem as Duration;
130118
if (item != null) {
131119
Settings.Default.DefaultDuration = item.Minutes;
@@ -154,8 +142,7 @@ private void addCustomDurationBTN_Click(object sender, EventArgs e) {
154142
int newDuration = 0;
155143
int.TryParse(CustomDurationTXBX.Text, out newDuration);
156144

157-
if ( newDuration < 0)
158-
{
145+
if ( newDuration < 0) {
159146
CustomDurationTXBX.Text = "";
160147
MessageBox.Show(
161148
"Enter a positive number.",
@@ -165,8 +152,7 @@ private void addCustomDurationBTN_Click(object sender, EventArgs e) {
165152
return;
166153
}
167154

168-
if (Settings.Default.RealDurations.Contains(newDuration))
169-
{
155+
if (Settings.Default.RealDurations.Contains(newDuration)) {
170156
CustomDurationTXBX.Text = "";
171157
MessageBox.Show(
172158
$"{newDuration} is already a duration.",
@@ -176,16 +162,14 @@ private void addCustomDurationBTN_Click(object sender, EventArgs e) {
176162
return;
177163
}
178164

179-
Duration newCustomDuration = new Duration
180-
{
165+
Duration newCustomDuration = new Duration {
181166
Minutes = newDuration
182167
};
183168

184169
Durations.Add(newCustomDuration);
185170
var sortedDurations = Durations.OrderByDescending(i => i).ToList();
186171
Durations.Clear();
187-
foreach (var item in sortedDurations)
188-
{
172+
foreach (var item in sortedDurations) {
189173
Durations.Add(item);
190174
}
191175
Settings.Default.RealDurations.Add(newDuration);
@@ -194,18 +178,15 @@ private void addCustomDurationBTN_Click(object sender, EventArgs e) {
194178
CustomDurationTXBX.Text = "";
195179
}
196180

197-
private void defaultRDBTN_Click(object sender, EventArgs e)
198-
{
181+
private void defaultRDBTN_Click(object sender, EventArgs e) {
199182
Settings.Default.Icon = "Default";
200183
}
201184

202-
private void eyeZZZRDBTN_Click(object sender, EventArgs e)
203-
{
185+
private void eyeZZZRDBTN_Click(object sender, EventArgs e) {
204186
Settings.Default.Icon = "Eye-ZZZ";
205187
}
206188

207-
private void mugRDBTN_Click(object sender, EventArgs e)
208-
{
189+
private void mugRDBTN_Click(object sender, EventArgs e) {
209190
Settings.Default.Icon = "Mug";
210191
}
211192
}

0 commit comments

Comments
 (0)