@@ -98,7 +98,8 @@ public class OsBrandStringHelper
98
98
{ "10.0.18363" , "10 19H2 [1909, November 2019 Update]" } ,
99
99
{ "10.0.19041" , "10 20H1 [2004, May 2020 Update]" } ,
100
100
{ "10.0.19042" , "10 20H2 [20H2, October 2020 Update]" } ,
101
- { "10.0.19043" , "10 21H1 [21H1, May 2021 Update]" }
101
+ { "10.0.19043" , "10 21H1 [21H1, May 2021 Update]" } ,
102
+ { "10.0.19044" , "10 21H2 [21H2]" }
102
103
} ;
103
104
104
105
private class Windows10Version
@@ -122,13 +123,15 @@ private Windows10Version(string version, [NotNull] string codeName, [NotNull] st
122
123
private string ToFullVersion ( [ CanBeNull ] int ? ubr = null )
123
124
=> ubr == null ? $ "10.0.{ BuildNumber } " : $ "10.0.{ BuildNumber } .{ ubr } ";
124
125
126
+ private static string Collapse ( params string [ ] values ) => string . Join ( "/" , values . Where ( v => ! string . IsNullOrEmpty ( v ) ) ) ;
127
+
125
128
// The line with OsBrandString is one of the longest lines in the summary.
126
129
// When people past in on GitHub, it can be a reason of an ugly horizontal scrollbar.
127
130
// To avoid this, we are trying to minimize this line and use the minimum possible number of characters.
128
131
public string ToPrettifiedString ( [ CanBeNull ] int ? ubr )
129
132
=> Version == ShortifiedCodeName
130
- ? $ "{ ToFullVersion ( ubr ) } ({ Version } / { ShortifiedMarketingName } )"
131
- : $ "{ ToFullVersion ( ubr ) } ({ Version } / { ShortifiedMarketingName } / { ShortifiedCodeName } )";
133
+ ? $ "{ ToFullVersion ( ubr ) } ({ Collapse ( Version , ShortifiedMarketingName ) } )"
134
+ : $ "{ ToFullVersion ( ubr ) } ({ Collapse ( Version , ShortifiedMarketingName , ShortifiedCodeName ) } )";
132
135
133
136
// See https://en.wikipedia.org/wiki/Windows_10_version_history
134
137
private static readonly List < Windows10Version > WellKnownVersions = new List < Windows10Version >
@@ -145,6 +148,7 @@ public string ToPrettifiedString([CanBeNull] int? ubr)
145
148
new Windows10Version ( "2004" , "20H1" , "May 2020 Update" , 19041 ) ,
146
149
new Windows10Version ( "20H2" , "20H2" , "October 2020 Update" , 19042 ) ,
147
150
new Windows10Version ( "21H1" , "21H1" , "May 2021 Update" , 19043 ) ,
151
+ new Windows10Version ( "21H2" , "21H2" , "" , 19044 ) , // The markingName is not announced yet
148
152
} ;
149
153
150
154
[ CanBeNull ]
@@ -209,7 +213,8 @@ private MacOSXVersion(int darwinVersion, [NotNull] string codeName)
209
213
new MacOSXVersion ( 17 , "High Sierra" ) ,
210
214
new MacOSXVersion ( 18 , "Mojave" ) ,
211
215
new MacOSXVersion ( 19 , "Catalina" ) ,
212
- new MacOSXVersion ( 20 , "Big Sur" )
216
+ new MacOSXVersion ( 20 , "Big Sur" ) ,
217
+ new MacOSXVersion ( 21 , "Monterey" )
213
218
} ;
214
219
215
220
[ CanBeNull ]
0 commit comments