public static string GetExtendedFileName(this IRun run, bool useExtendedCategoryName = true) { var extendedName = run.GetExtendedName(useExtendedCategoryName); var stringBuilder = new StringBuilder(); foreach (var c in extendedName) { if (c != '\\' && c != '/' && c != ':' && c != '*' && c != '?' && c != '"' && c != '<' && c != '>' && c != '|') { stringBuilder.Append(c); } } return(stringBuilder.ToString()); }