99using SmartImage . Searching ;
1010using SmartImage . Utilities ;
1111
12- #pragma warning disable IDE0052
12+ #pragma warning disable IDE0052 , HAA0502 , HAA0505 , HAA0601 , HAA0502 , HAA0101
1313
1414
1515namespace SmartImage
@@ -43,26 +43,25 @@ private static NConsoleOption[] AllOptions
4343 /// <summary>
4444 /// Main menu console interface
4545 /// </summary>
46- internal static NConsoleUI Interface => new NConsoleUI ( AllOptions , RuntimeInfo . NAME_BANNER , false ) ;
46+ internal static NConsoleUI Interface => new NConsoleUI ( AllOptions , RuntimeInfo . NAME_BANNER ) ;
4747
4848 /// <summary>
4949 /// Runs when no arguments are given (and when the executable is double-clicked)
5050 /// </summary>
5151 /// <remarks>
5252 /// More user-friendly menu
5353 /// </remarks>
54- internal static void Run ( ) => NConsole . IO . HandleOptions ( ConsoleMainMenu . Interface ) ;
54+ internal static void Run ( ) => NConsole . IO . HandleOptions ( Interface ) ;
5555
56- private static readonly NConsoleOption RunSelectImage = new NConsoleOption ( )
56+ private static readonly NConsoleOption RunSelectImage = new NConsoleOption
5757 {
5858 Name = ">>> Select image <<<" ,
5959 Color = Color . Yellow ,
6060 Function = ( ) =>
6161 {
6262 Console . WriteLine ( "Drag and drop the image here." ) ;
63- Console . Write ( "Image: " ) ;
64-
65- string img = Console . ReadLine ( ) ;
63+
64+ string img = NConsole . IO . GetInput ( "Image" ) ;
6665 img = Strings . CleanString ( img ) ;
6766
6867 SearchConfig . Config . Image = img ;
@@ -72,15 +71,15 @@ private static NConsoleOption[] AllOptions
7271 } ;
7372
7473
75- private static readonly NConsoleOption ConfigSearchEnginesOption = new NConsoleOption ( )
74+ private static readonly NConsoleOption ConfigSearchEnginesOption = new NConsoleOption
7675 {
7776 Name = "Configure search engines" ,
7877 Function = ( ) =>
7978 {
80- var rgEnum = NConsoleOption . CreateOptionsFromEnum < SearchEngines > ( ) ;
79+ var rgEnum = NConsoleOption . CreateOptionsFromEnum < SearchEngineOptions > ( ) ;
8180 var values = NConsole . IO . HandleOptions ( rgEnum , true ) ;
8281
83- var newValues = Enums . ReadEnumFromSet < SearchEngines > ( values ) ;
82+ var newValues = Enums . ReadEnumFromSet < SearchEngineOptions > ( values ) ;
8483
8584 NConsole . WriteInfo ( newValues ) ;
8685
@@ -93,15 +92,15 @@ private static NConsoleOption[] AllOptions
9392 } ;
9493
9594
96- private static readonly NConsoleOption ConfigPriorityEnginesOption = new NConsoleOption ( )
95+ private static readonly NConsoleOption ConfigPriorityEnginesOption = new NConsoleOption
9796 {
9897 Name = "Configure priority engines" ,
9998 Function = ( ) =>
10099 {
101- var rgEnum = NConsoleOption . CreateOptionsFromEnum < SearchEngines > ( ) ;
100+ var rgEnum = NConsoleOption . CreateOptionsFromEnum < SearchEngineOptions > ( ) ;
102101 var values = NConsole . IO . HandleOptions ( rgEnum , true ) ;
103102
104- var newValues = Enums . ReadEnumFromSet < SearchEngines > ( values ) ;
103+ var newValues = Enums . ReadEnumFromSet < SearchEngineOptions > ( values ) ;
105104
106105 NConsole . WriteInfo ( newValues ) ;
107106
@@ -114,7 +113,7 @@ private static NConsoleOption[] AllOptions
114113 } ;
115114
116115
117- private static readonly NConsoleOption ConfigSauceNaoAuthOption = new NConsoleOption ( )
116+ private static readonly NConsoleOption ConfigSauceNaoAuthOption = new NConsoleOption
118117 {
119118 Name = "Configure SauceNao API authentication" ,
120119 Function = ( ) =>
@@ -126,7 +125,7 @@ private static NConsoleOption[] AllOptions
126125 }
127126 } ;
128127
129- private static readonly NConsoleOption ConfigImgurAuthOption = new NConsoleOption ( )
128+ private static readonly NConsoleOption ConfigImgurAuthOption = new NConsoleOption
130129 {
131130 Name = "Configure Imgur API authentication" ,
132131 Function = ( ) =>
@@ -139,7 +138,7 @@ private static NConsoleOption[] AllOptions
139138 }
140139 } ;
141140
142- private static readonly NConsoleOption ConfigUpdateOption = new NConsoleOption ( )
141+ private static readonly NConsoleOption ConfigUpdateOption = new NConsoleOption
143142 {
144143 Name = "Update configuration file" ,
145144 Function = ( ) =>
@@ -151,7 +150,7 @@ private static NConsoleOption[] AllOptions
151150 }
152151 } ;
153152
154- private static readonly NConsoleOption ContextMenuOption = new NConsoleOption ( )
153+ private static readonly NConsoleOption ContextMenuOption = new NConsoleOption
155154 {
156155 Name = "Add/remove context menu integration" ,
157156 Function = ( ) =>
@@ -172,7 +171,7 @@ private static NConsoleOption[] AllOptions
172171 }
173172 } ;
174173
175- private static readonly NConsoleOption ShowInfoOption = new NConsoleOption ( )
174+ private static readonly NConsoleOption ShowInfoOption = new NConsoleOption
176175 {
177176 Name = "Show info" ,
178177 Function = ( ) =>
@@ -184,33 +183,32 @@ private static NConsoleOption[] AllOptions
184183 }
185184 } ;
186185
187- private static readonly NConsoleOption CheckForUpdateOption = new NConsoleOption ( )
186+
187+ private static readonly NConsoleOption CheckForUpdateOption = new NConsoleOption
188188 {
189189 Name = "Check for updates" ,
190190 Function = ( ) =>
191191 {
192- // TODO: WIP
193-
194192 var v = UpdateInfo . CheckForUpdates ( ) ;
195193
196194 if ( ( v . Status == VersionStatus . Available ) ) {
197195
198196 UpdateInfo . Update ( ) ;
199-
197+
200198 // No return
201199 Environment . Exit ( 0 ) ;
202200
203201 }
204202 else {
205- NConsole . WriteSuccess ( "{0}" , v . Status ) ;
203+ NConsole . WriteInfo ( "{0}" , v . Status ) ;
206204 }
207205
208206 NConsole . IO . WaitForSecond ( ) ;
209207 return null ;
210208 }
211209 } ;
212210
213- private static readonly NConsoleOption ResetOption = new NConsoleOption ( )
211+ private static readonly NConsoleOption ResetOption = new NConsoleOption
214212 {
215213 Name = "Reset all configuration and integrations" ,
216214 Function = ( ) =>
@@ -222,7 +220,7 @@ private static NConsoleOption[] AllOptions
222220 }
223221 } ;
224222
225- private static readonly NConsoleOption UninstallOption = new NConsoleOption ( )
223+ private static readonly NConsoleOption UninstallOption = new NConsoleOption
226224 {
227225 Name = "Uninstall" ,
228226 Function = ( ) =>
@@ -252,7 +250,7 @@ private static NConsoleOption[] AllOptions
252250 "Test3.png"
253251 } ;
254252
255- private static readonly NConsoleOption DebugTestOption = new NConsoleOption ( )
253+ private static readonly NConsoleOption DebugTestOption = new NConsoleOption
256254 {
257255 Name = "[DEBUG] Run test" ,
258256 Function = ( ) =>
@@ -261,13 +259,11 @@ private static NConsoleOption[] AllOptions
261259 var cd2 = cd . Parent . Parent . Parent . Parent . ToString ( ) ;
262260
263261
264- var testImg = Collections . GetRandomElement ( TestImages ) ;
262+ var testImg = TestImages . GetRandomElement ( ) ;
265263 var img = Path . Combine ( cd2 , testImg ) ;
266264
267265 SearchConfig . Config . Image = img ;
268- SearchConfig . Config . PriorityEngines = SearchEngines . None ;
269- //SearchConfig.Config.ImgurAuth = "6c97880bf8754c5";
270- //SearchConfig.Config.SearchEngines &= ~SearchEngines.TraceMoe;
266+ SearchConfig . Config . PriorityEngines = SearchEngineOptions . None ;
271267
272268
273269 return true ;
0 commit comments