@@ -98,7 +98,8 @@ public class OsBrandStringHelper
9898 { "10.0.18363" , "10 19H2 [1909, November 2019 Update]" } ,
9999 { "10.0.19041" , "10 20H1 [2004, May 2020 Update]" } ,
100100 { "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]" }
102103 } ;
103104
104105 private class Windows10Version
@@ -122,13 +123,15 @@ private Windows10Version(string version, [NotNull] string codeName, [NotNull] st
122123 private string ToFullVersion ( [ CanBeNull ] int ? ubr = null )
123124 => ubr == null ? $ "10.0.{ BuildNumber } " : $ "10.0.{ BuildNumber } .{ ubr } ";
124125
126+ private static string Collapse ( params string [ ] values ) => string . Join ( "/" , values . Where ( v => ! string . IsNullOrEmpty ( v ) ) ) ;
127+
125128 // The line with OsBrandString is one of the longest lines in the summary.
126129 // When people past in on GitHub, it can be a reason of an ugly horizontal scrollbar.
127130 // To avoid this, we are trying to minimize this line and use the minimum possible number of characters.
128131 public string ToPrettifiedString ( [ CanBeNull ] int ? ubr )
129132 => 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 ) } )";
132135
133136 // See https://en.wikipedia.org/wiki/Windows_10_version_history
134137 private static readonly List < Windows10Version > WellKnownVersions = new List < Windows10Version >
@@ -145,6 +148,7 @@ public string ToPrettifiedString([CanBeNull] int? ubr)
145148 new Windows10Version ( "2004" , "20H1" , "May 2020 Update" , 19041 ) ,
146149 new Windows10Version ( "20H2" , "20H2" , "October 2020 Update" , 19042 ) ,
147150 new Windows10Version ( "21H1" , "21H1" , "May 2021 Update" , 19043 ) ,
151+ new Windows10Version ( "21H2" , "21H2" , "" , 19044 ) , // The markingName is not announced yet
148152 } ;
149153
150154 [ CanBeNull ]
@@ -209,7 +213,8 @@ private MacOSXVersion(int darwinVersion, [NotNull] string codeName)
209213 new MacOSXVersion ( 17 , "High Sierra" ) ,
210214 new MacOSXVersion ( 18 , "Mojave" ) ,
211215 new MacOSXVersion ( 19 , "Catalina" ) ,
212- new MacOSXVersion ( 20 , "Big Sur" )
216+ new MacOSXVersion ( 20 , "Big Sur" ) ,
217+ new MacOSXVersion ( 21 , "Monterey" )
213218 } ;
214219
215220 [ CanBeNull ]
0 commit comments