public FileSystemBrowserControl() { _regexes = new List <Regex>(); InitializeComponent(); FileImages.Images.Add("_Folder", FileSystemIcons.GetFolderIcon(FileSystemIcons.SystemIconSize.Small, FileSystemIcons.SystemFolderType.Open)); FileImages.Images.Add("_Unknown", FileSystemIcons.IconFromExtension(".unknown", FileSystemIcons.SystemIconSize.Small)); }
private string GetIcon(string file) { var ext = (Path.GetExtension(file) ?? "").Trim('.').ToLower(); if (ext == "") { return("_Unknown"); } if (!FileImages.Images.ContainsKey(ext)) { FileImages.Images.Add(ext, FileSystemIcons.IconFromExtension(ext, FileSystemIcons.SystemIconSize.Small)); } return(ext); }