internal static FileDialogFilterBuilder GetProjectsFilter(ExtensionSettingsProjectCollection projectTypes) { FileDialogFilterBuilder builder; builder = new FileDialogFilterBuilder(); foreach (string projectType in projectTypes) { int endOfNamePosition; string projectName; string projectFilter; endOfNamePosition = projectType.IndexOf('|'); if (endOfNamePosition == -1) { projectName = projectType; projectFilter = projectType; } else { projectName = projectType.Substring(0, endOfNamePosition); projectFilter = projectType.Substring(endOfNamePosition + 1); } builder.Add(projectName, projectFilter); } builder.AddAllFiles(); return(builder); }
internal static FileDialogFilterBuilder GetProjectsFilter() { FileDialogFilterBuilder builder; builder = new FileDialogFilterBuilder(); builder.Add("C# Projects", "*.csproj"); builder.Add("Visual Basic Projects", "*.vbproj"); builder.Add("C++ Projects", "*.vcproj;*.vcxproj"); builder.Add("F# Projects", "*.fsproj"); builder.AddAllFiles(); return builder; }
private static string CreateFilter(bool isLoad) { var filterBuilder = new FileDialogFilterBuilder(); filterBuilder.Add("Project Files", string.Format("*{0}", defaultExtension)); if (isLoad) { filterBuilder.Add("Legacy Project Files", "*.gifprj"); filterBuilder.Add("XML Project Files", "*.xml"); filterBuilder.AddAllFiles(); } return(filterBuilder.ToString()); }