@@ -10,7 +10,15 @@ public class Column : IColumn
1010 private const int MAXLENGTH = 4678 - 3 ;
1111 private const string REPLACEMENT = "..." ;
1212
13- private static readonly IEnumerable < Func < string , string > > _replacements ;
13+ private static readonly List < Func < string , string > > _replacements = [
14+ //replace tab with 3 spaces, from old coding. Needed???
15+ input => input . Replace ( "\t " , " " , StringComparison . Ordinal ) ,
16+
17+ //shorten string if it exceeds maxLength
18+ input => input . Length > MAXLENGTH
19+ ? string . Concat ( input . AsSpan ( 0 , MAXLENGTH ) , REPLACEMENT )
20+ : input
21+ ] ;
1422
1523 private string _fullValue ;
1624
@@ -20,32 +28,19 @@ public class Column : IColumn
2028
2129 static Column ( )
2230 {
23- var replacements = new List < Func < string , string > > (
24- [
25- //replace tab with 3 spaces, from old coding. Needed???
26- input => input . Replace ( "\t " , " " , StringComparison . Ordinal ) ,
27-
28- //shorten string if it exceeds maxLength
29- input => input . Length > MAXLENGTH
30- ? string . Concat ( input . AsSpan ( 0 , MAXLENGTH ) , REPLACEMENT )
31- : input
32- ] ) ;
33-
3431 if ( Environment . Version >= Version . Parse ( "6.2" ) )
3532 {
3633 //Win8 or newer support full UTF8 chars with the preinstalled fonts.
3734 //Replace null char with UTF8 Symbol U+2400 (␀)
38- replacements . Add ( input => input . Replace ( "\0 " , "␀" , StringComparison . Ordinal ) ) ;
35+ _replacements . Add ( input => input . Replace ( "\0 " , "␀" , StringComparison . Ordinal ) ) ;
3936 }
4037 else
4138 {
4239 //Everything below Win8 the installed fonts seems to not to support reliabel
4340 //Replace null char with space
44- replacements . Add ( input => input . Replace ( "\0 " , " " , StringComparison . Ordinal ) ) ;
41+ _replacements . Add ( input => input . Replace ( "\0 " , " " , StringComparison . Ordinal ) ) ;
4542 }
4643
47- _replacements = replacements ;
48-
4944 EmptyColumn = new Column { FullValue = string . Empty } ;
5045 }
5146
@@ -77,7 +72,7 @@ public string FullValue
7772
7873 public string DisplayValue { get ; private set ; }
7974
80- string ITextValue . Text => DisplayValue ;
75+ public string Text => DisplayValue ;
8176
8277 #endregion
8378
0 commit comments