@@ -182,30 +182,28 @@ private void OnLoaded(object sender, RoutedEventArgs _)
182
182
183
183
private void InitializePosition ( )
184
184
{
185
- if ( _settings . LauncherPosition == "RememberLastLaunchLocation" )
185
+ switch ( _settings . LauncherPosition )
186
186
{
187
- Top = _settings . WindowTop ;
188
- Left = _settings . WindowLeft ;
189
- }
190
- else if ( _settings . LauncherPosition == "MouseScreenCenter" )
191
- {
192
- Left = WindowLeft ( ) ;
193
- Top = WindowTop ( ) ;
194
- }
195
- else if ( _settings . LauncherPosition == "MouseScreenCenterTop" )
196
- {
197
- Left = WindowLeft ( ) ;
198
- Top = 10 ;
199
- }
200
- else if ( _settings . LauncherPosition == "MouseScreenLeftTop" )
201
- {
202
- Left = 10 ;
203
- Top = 10 ;
204
- }
205
- else if ( _settings . LauncherPosition == "MouseScreenRightTop" )
206
- {
207
- Left = WindowRight ( ) ;
208
- Top = 10 ;
187
+ case LauncherPositions . RememberLastLaunchLocation :
188
+ Top = _settings . WindowTop ;
189
+ Left = _settings . WindowLeft ;
190
+ break ;
191
+ case LauncherPositions . MouseScreenCenter :
192
+ Left = WindowLeft ( ) ;
193
+ Top = WindowTop ( ) ;
194
+ break ;
195
+ case LauncherPositions . MouseScreenCenterTop :
196
+ Left = WindowLeft ( ) ;
197
+ Top = 10 ;
198
+ break ;
199
+ case LauncherPositions . MouseScreenLeftTop :
200
+ Left = 10 ;
201
+ Top = 10 ;
202
+ break ;
203
+ case LauncherPositions . MouseScreenRightTop :
204
+ Left = WindowRight ( ) ;
205
+ Top = 10 ;
206
+ break ;
209
207
}
210
208
}
211
209
@@ -445,39 +443,14 @@ private void UpdatePosition()
445
443
{
446
444
if ( _animating )
447
445
return ;
448
-
449
- if ( _settings . LauncherPosition == "RememberLastLaunchLocation" )
450
- {
451
- Left = _settings . WindowLeft ;
452
- Top = _settings . WindowTop ;
453
- }
454
- else if ( _settings . LauncherPosition == "MouseScreenCenter" )
455
- {
456
- Left = WindowLeft ( ) ;
457
- Top = WindowTop ( ) ;
458
- }
459
- else if ( _settings . LauncherPosition == "MouseScreenCenterTop" )
460
- {
461
- Left = WindowLeft ( ) ;
462
- Top = 10 ;
463
- }
464
- else if ( _settings . LauncherPosition == "MouseScreenLeftTop" )
465
- {
466
- Left = 10 ;
467
- Top = 10 ;
468
- }
469
- else if ( _settings . LauncherPosition == "MouseScreenRightTop" )
470
- {
471
- Left = WindowRight ( ) ;
472
- Top = 10 ;
473
- }
446
+ InitializePosition ( ) ;
474
447
}
475
448
476
449
private void OnLocationChanged ( object sender , EventArgs e )
477
450
{
478
451
if ( _animating )
479
452
return ;
480
- if ( _settings . LauncherPosition == " RememberLastLaunchLocation" )
453
+ if ( _settings . LauncherPosition == LauncherPositions . RememberLastLaunchLocation )
481
454
{
482
455
_settings . WindowLeft = Left ;
483
456
_settings . WindowTop = Top ;
0 commit comments