File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -380,22 +380,24 @@ protected void setCulture(IDictionary<string, string> keys)
380380 }
381381
382382 /// <summary>
383- /// Extracts arguments by format:
383+ /// Extracts arguments using format:
384384 /// name1=value1;name2=value2;name3=value3
385385 /// http://msdn.microsoft.com/en-us/library/ms164311.aspx
386386 /// </summary>
387387 /// <param name="raw">Multiple properties separated by semicolon</param>
388388 /// <returns></returns>
389389 protected IDictionary < string , string > extractArguments ( string raw )
390390 {
391- if ( String . IsNullOrEmpty ( raw ) ) {
391+ if ( string . IsNullOrWhiteSpace ( raw ) ) {
392392 return new Dictionary < string , string > ( ) ;
393393 }
394394
395395 return raw . Split ( ';' )
396396 . Select ( p => p . Split ( '=' ) )
397- . Select ( p => new KeyValuePair < string , string > ( p [ 0 ] , ( p . Length < 2 ) ? null : p [ 1 ] ) )
398- . ToDictionary ( k => k . Key , v => v . Value ) ;
397+ . GroupBy ( p => p [ 0 ] . Trim ( ) ) // ... /p:nowarn=1701 /p:nowarn=1702
398+ . Select ( p => p . Last ( ) )
399+ . Where ( p => ! string . IsNullOrWhiteSpace ( p [ 0 ] ) )
400+ . ToDictionary ( p => p [ 0 ] . Trim ( ) , p => ( p . Length < 2 ) ? null : p [ 1 ] ) ;
399401 }
400402 }
401403}
You can’t perform that action at this time.
0 commit comments