7
7
using Microsoft . UI . Xaml . Input ;
8
8
using Microsoft . UI . Xaml . Media . Imaging ;
9
9
using Microsoft . Win32 ;
10
- using System ;
11
- using System . Collections . Generic ;
12
- using System . IO ;
13
- using System . Reflection ;
14
- using System . Threading . Tasks ;
15
- using UniGetUI . Core ;
10
+ using System . Runtime . InteropServices ;
16
11
using UniGetUI . Core . Data ;
17
- using UniGetUI . Interface . Widgets ;
18
- using UniGetUI . PackageEngine . Classes ;
19
- using Windows . ApplicationModel . DataTransfer ;
20
12
using UniGetUI . Core . Logging ;
21
- using Windows . Foundation . Collections ;
22
13
using UniGetUI . Core . SettingsEngine ;
23
- using UniGetUI . PackageEngine . PackageClasses ;
24
14
using UniGetUI . Core . Tools ;
25
- using System . Runtime . InteropServices ;
15
+ using UniGetUI . Interface . Widgets ;
16
+ using UniGetUI . PackageEngine . PackageClasses ;
17
+ using Windows . ApplicationModel . DataTransfer ;
18
+ using Windows . Foundation . Collections ;
26
19
27
20
namespace UniGetUI . Interface
28
21
{
@@ -500,7 +493,7 @@ private async void SaveGeometry()
500
493
}
501
494
else Logger . Warn ( "MainWindow.AppWindow.Presenter is not OverlappedPresenter presenter!" ) ;
502
495
503
- var geometry = $ "{ AppWindow . Position . X } ,{ AppWindow . Position . Y } ,{ AppWindow . Size . Width } ,{ AppWindow . Size . Height } ,{ windowState } ";
496
+ string geometry = $ "{ AppWindow . Position . X } ,{ AppWindow . Position . Y } ,{ AppWindow . Size . Width } ,{ AppWindow . Size . Height } ,{ windowState } ";
504
497
505
498
Logger . Debug ( $ "Saving window geometry { geometry } ") ;
506
499
Settings . SetValue ( "WindowGeometry" , geometry ) ;
@@ -509,7 +502,7 @@ private async void SaveGeometry()
509
502
private void RestoreSize ( )
510
503
{
511
504
512
- var geometry = Settings . GetValue ( "WindowGeometry" ) ;
505
+ string geometry = Settings . GetValue ( "WindowGeometry" ) ;
513
506
string [ ] items = geometry . Split ( "," ) ;
514
507
if ( items . Length != 5 )
515
508
{
@@ -550,11 +543,11 @@ private void RestoreSize()
550
543
}
551
544
private bool IsRectangleFullyVisible ( int x , int y , int width , int height )
552
545
{
553
- List < MONITORINFO > monitorInfos = new List < MONITORINFO > ( ) ;
546
+ List < MONITORINFO > monitorInfos = new ( ) ;
554
547
555
548
MonitorEnumDelegate callback = ( IntPtr hMonitor , IntPtr hdcMonitor , ref RECT lprcMonitor , IntPtr dwData ) =>
556
549
{
557
- MONITORINFO monitorInfo = new MONITORINFO ( ) ;
550
+ MONITORINFO monitorInfo = new ( ) ;
558
551
monitorInfo . cbSize = Marshal . SizeOf ( typeof ( MONITORINFO ) ) ;
559
552
if ( GetMonitorInfo ( hMonitor , ref monitorInfo ) ) monitorInfos . Add ( monitorInfo ) ;
560
553
return true ;
@@ -567,7 +560,7 @@ private bool IsRectangleFullyVisible(int x, int y, int width, int height)
567
560
int maxX = int . MinValue ;
568
561
int maxY = int . MinValue ;
569
562
570
- foreach ( var monitorInfo in monitorInfos )
563
+ foreach ( MONITORINFO monitorInfo in monitorInfos )
571
564
{
572
565
if ( monitorInfo . rcMonitor . Left < minX ) minX = monitorInfo . rcMonitor . Left ;
573
566
if ( monitorInfo . rcMonitor . Top < minY ) minY = monitorInfo . rcMonitor . Top ;
0 commit comments