Sky Software Homepage LogicNP Software Knowledge Base And FAQ

 
Contact Product Support    SearchSearch      Subscribe to the RSS feed for this forum

HOWTO: Always show extensions for files irrespective of the OS setting

 
Subscribe to the RSS feed for this forum  Forum Index -> FileView.Net/WPF
View previous topic :: View next topic  
Author Message
Support



Joined: 18 Jul 2005
Posts: 731

Posted: Tue Apr 21, 2009 4:14 am    Post subject: HOWTO: Always show extensions for files irrespective of the OS setting

FileView follows the "Hide File Extensions for Known File Types" setting in Windows Explorer - if it is ON, FileView hides the extension of a file (for example, 'notes.txt' is displayed as simply 'notes').

To force FileView to always show the extension irrespective of the OS setting, use the following code in the AfterItemAdd event:

Code:
// Only show extensions for non-folders belonging to the file-system
ItemAttributes attr = e.Item.GetAttributes(ItemAttributes.FileSys| ItemAttributes.Folder);
if((attr & ItemAttributes.FileSys)!=0 && (attr & ItemAttributes.Folder)==0)
{
e.Item.Text = e.Item.GetDisplayNameEx(DisplayNameFlags.ForParsing| DisplayNameFlags.InFolder);

}
Back to top
Display posts from previous:   
Forum Index -> FileView.Net/WPF All times are GMT
Page 1 of 1

 
Jump to:  


Powered by phpBB © 2001, 2005 phpBB Group