text: public static string FileNameFromGeneration(string @base, string ext, long gen){if (gen == -1){return null;}else if (gen == 0){return SegmentFileName(@base, "", ext);}else{Debug.Assert(gen > 0);StringBuilder res = (new StringBuilder(@base.Length + 6 + ext.Length)).Append(@base).Append('_').Append(gen.ToString(Character.MaxRadix));if (ext.Length > 0){res.Append('.').Append(ext);}return res.ToString();}}