File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using System ;
2+ using System . Globalization ;
23
34namespace Microsoft . Windows . PowerShell . ScriptAnalyzer
45{
6+ // TODO doc
57 public class Range
68 {
79 public Position Start { get ; }
@@ -10,7 +12,9 @@ public Range(Position start, Position end)
1012 {
1113 if ( start > end )
1214 {
13- throw new ArgumentException ( "start position cannot be before end position." ) ;
15+ throw new ArgumentException ( String . Format (
16+ CultureInfo . CurrentCulture ,
17+ Strings . RangeStartPosGreaterThanEndPos ) ) ;
1418 }
1519
1620 Start = new Position ( start ) ;
@@ -57,7 +61,9 @@ public static Range Normalize(Position refPosition, Range range)
5761
5862 if ( refPosition > range . Start )
5963 {
60- throw new ArgumentException ( "reference range should start before range" ) ;
64+ throw new ArgumentException ( String . Format (
65+ CultureInfo . CurrentCulture ,
66+ Strings . RangeRefPosShouldStartBeforeRangeStartPos ) ) ;
6167 }
6268
6369 return range . Shift (
Original file line number Diff line number Diff line change 303303 <data name =" EditableTextInvalidLineEnding" xml : space =" preserve" >
304304 <value >Cannot determine line endings as the text probably contain mixed line endings.</value >
305305 </data >
306+ <data name =" RangeStartPosGreaterThanEndPos" xml : space =" preserve" >
307+ <value >Start position cannot be before End position.</value >
308+ </data >
309+ <data name =" RangeRefPosShouldStartBeforeRangeStartPos" xml : space =" preserve" >
310+ <value >Reference Position should begin before start Position of Range.</value >
311+ </data >
306312</root >
You can’t perform that action at this time.
0 commit comments