11using System ;
22using System . ComponentModel ;
33using System . Diagnostics ;
4- using System . Drawing ;
5- using System . IO ;
64using System . Linq ;
7- using System . Reflection ;
85using System . Windows . Forms ;
96using Caffeinated . Properties ;
10- using Microsoft . Win32 ;
117using Windows . ApplicationModel ;
12- using vm = Windows . UI . ViewManagement ;
138
149namespace 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