55* PURPOSE: Basic Console app, to get my own tools running
66* PROGRAMMER: Peter Geinitz (Wayfarer)
77*/
8+
89using System ;
910using System . Collections . Generic ;
1011using System . IO ;
@@ -25,22 +26,26 @@ internal static class Program
2526 /// The prompt
2627 /// </summary>
2728 private static Prompt _prompt ;
29+
2830 /// <summary>
2931 /// The console lock
3032 /// </summary>
3133 private static readonly object ConsoleLock = new ( ) ;
34+
3235 /// <summary>
3336 /// The is event triggered
3437 /// </summary>
3538 private static bool _isEventTriggered ;
39+
3640 /// <summary>
3741 /// The analyzers
3842 /// </summary>
3943 private static readonly List < ICodeAnalyzer > Analyzers = new ( ) ;
44+
4045 /// <summary>
4146 /// Defines the entry point of the application.
4247 /// </summary>
43- /// <param name = "args">The arguments.</param>
48+ /// <param name= "args">The arguments.</param>
4449 private static void Main ( string [ ] args )
4550 {
4651 //add our analyzers
@@ -69,7 +74,7 @@ private static void Main(string[] args)
6974 if ( args . Length > 3 && File . Exists ( args [ 3 ] ) )
7075 {
7176 ignoreList = new List < string > ( File . ReadAllLines ( args [ 3 ] ) ) ;
72- Console . WriteLine ( string . Format ( ConResources . Resource20 , ignoreList . Count ) ) ;
77+ Console . WriteLine ( ConResources . Resource20 , ignoreList . Count ) ;
7378 }
7479
7580 if ( args . Length > 4 && File . Exists ( args [ 4 ] ) )
@@ -82,11 +87,11 @@ private static void Main(string[] args)
8287 }
8388 catch ( Exception ex )
8489 {
85- Console . WriteLine ( string . Format ( ConResources . Resource21 , pattern , ex . Message ) ) ;
90+ Console . WriteLine ( ConResources . Resource21 , pattern , ex . Message ) ;
8691 }
8792 }
8893
89- Console . WriteLine ( string . Format ( ConResources . Resource22 , ignorePatterns . Count ) ) ;
94+ Console . WriteLine ( ConResources . Resource22 , ignorePatterns . Count ) ;
9095 }
9196
9297 IResourceExtractor resXtractExtractor = new ResXtract ( ignoreList , ignorePatterns ) ;
@@ -116,6 +121,7 @@ private static void Initiate()
116121 _prompt . ConsoleInput ( ConResources . ResourceUsingCmd ) ;
117122 _prompt . Callback ( Environment . NewLine ) ;
118123 _prompt . ConsoleInput ( ConResources . ResourceListCmd ) ;
124+
119125 while ( true )
120126 {
121127 lock ( ConsoleLock )
@@ -139,8 +145,8 @@ private static void Initiate()
139145 /// <summary>
140146 /// Sends the commands.
141147 /// </summary>
142- /// <param name = "sender">The sender.</param>
143- /// <param name = "e">The e.</param>
148+ /// <param name= "sender">The sender.</param>
149+ /// <param name= "e">The e.</param>
144150 private static void SendCommands ( object sender , OutCommand e )
145151 {
146152 lock ( ConsoleLock )
@@ -157,7 +163,7 @@ private static void SendCommands(object sender, OutCommand e)
157163 /// <summary>
158164 /// Handles the commands.
159165 /// </summary>
160- /// <param name = "outCommand">The out command.</param>
166+ /// <param name= "outCommand">The out command.</param>
161167 private static void HandleCommands ( OutCommand outCommand )
162168 {
163169 if ( outCommand . Command == - 1 )
@@ -205,7 +211,7 @@ private static void HandleCommands(OutCommand outCommand)
205211 /// <summary>
206212 /// Handles the header.
207213 /// </summary>
208- /// <param name = "package">The package.</param>
214+ /// <param name= "package">The package.</param>
209215 /// <returns>Added headers.</returns>
210216 private static string HandleHeader ( OutCommand package )
211217 {
@@ -227,7 +233,7 @@ private static string HandleHeader(OutCommand package)
227233 /// <summary>
228234 /// Handles the resource xtract.
229235 /// </summary>
230- /// <param name = "package">The package.</param>
236+ /// <param name= "package">The package.</param>
231237 /// <returns>Result of the extraction.</returns>
232238 private static string HandleResxtract ( OutCommand package )
233239 {
@@ -262,7 +268,7 @@ private static string HandleResxtract(OutCommand package)
262268 // Optional: warn if file exists
263269 if ( File . Exists ( outputResourceFile ) )
264270 {
265- // Could add a warning here
271+ // Could add a warning here
266272 }
267273 }
268274 catch ( Exception ex )
@@ -274,21 +280,24 @@ private static string HandleResxtract(OutCommand package)
274280 var ignoreList = new List < string > ( ) ;
275281 var ignorePatterns = new List < string > ( ) ;
276282 IResourceExtractor extractor = new ResXtract ( ignoreList , ignorePatterns ) ;
277- var changedFiles = extractor . ProcessProject ( projectPath , outputResourceFile , replace : true ) ; // `null` is okay here
283+ var changedFiles =
284+ extractor . ProcessProject ( projectPath , outputResourceFile , replace : true ) ; // `null` is okay here
278285 if ( changedFiles . Count == 0 )
279286 {
280287 return ConResources . Resource16 ;
281288 }
282289
283290 var actualOutputFile = changedFiles . Last ( ) ; // Last item is outputResourceFile (by design)
284- var changedFilesList = string . Join ( Environment . NewLine + ConResources . Resource17 , changedFiles . Take ( changedFiles . Count - 1 ) ) ;
285- return string . Format ( ConResources . ResourceResxtractOutput , actualOutputFile , Environment . NewLine ) + string . Format ( ConResources . Resource28 , Environment . NewLine , changedFilesList ) ;
291+ var changedFilesList = string . Join ( Environment . NewLine + ConResources . Resource17 ,
292+ changedFiles . Take ( changedFiles . Count - 1 ) ) ;
293+ return string . Format ( ConResources . ResourceResxtractOutput , actualOutputFile , Environment . NewLine ) +
294+ string . Format ( ConResources . Resource28 , Environment . NewLine , changedFilesList ) ;
286295 }
287296
288297 /// <summary>
289298 /// Runs the analyzers.
290299 /// </summary>
291- /// <param name = "package">The package.</param>
300+ /// <param name= "package">The package.</param>
292301 /// <returns>Result of code analysis.</returns>
293302 private static string RunAnalyzers ( OutCommand package )
294303 {
@@ -338,8 +347,8 @@ private static string CleanPath(string path)
338347 /// <summary>
339348 /// Listen to Messages
340349 /// </summary>
341- /// <param name = "sender">Object</param>
342- /// <param name = "e">Type</param>
350+ /// <param name= "sender">Object</param>
351+ /// <param name= "e">Type</param>
343352 private static void SendLogs ( object sender , string e )
344353 {
345354 lock ( ConsoleLock )
0 commit comments