1

I have a folder with large number of files and application which shows these files in WPF list view. I want to allow user to group these files logically and display in treeview to make navigation easier. This can be done by putting files in to sub folders and this is not possible for some reasons. Another option is to create xml file to manage gropuing , but needs additional file. I want to add custome attibute or tag to file programmatically and read/write it as needed. The solution should work on most of windows os like xp,windows server 2003,vista & W7. Is this possible? Any other solution for logical grouping of files is also welcomed. Thanks.

2
  • Have you look at here? Or see this Commented Jun 15, 2012 at 4:17
  • 1
    This is not about C# attributes. This is about file attribute for ex. for any file in windows explorer you can right click and see properites which shows created date, midified date. For media files there will be addditional tags like autohor , singer , rating etc. I want to add such tag programmatically. Commented Jun 15, 2012 at 4:26

2 Answers 2

1

You could create your own logical grouping using database. This would be the best method without modifying existing files. I would suggest using RavenDB which is very very easy to use and has small footprint. You can use linq with it and no need for sql. All operation can be saved to memory too.

http://ravendb.net/

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for solution.This should work , but I am in more favours of doing without any additional dependency. Possibly pure C# solution.
@Prafulla Have a read at this post: stackoverflow.com/questions/220097/…. It looks like an ugly solution. Raven DB wouldn't add much overhead, just get it through NuGet
I think ID3 tag is only for media files and this info is part of file itself. So is related to file foramt.
@Prafulla That is unfortunate. You could also utilise file name to inject tags, but this is ugly. As per this article fileinfo object has only these attributes: dotnetperls.com/fileinfo. Just use DB solution as I suggested earlier, RavenDB is very fast for access (faster then reading/writing attributes to file) and I does custom indexing. You could also use Lucene.Net search indexing which is also superb for this kind of task and allows very advanced searching
DB solution is good. I have doubt about its acceptance by others bcz of company policies. NTFS file system has way to provide metadata. Here is link codeproject.com/Articles/2670/…. Lucene.Net is interesting and new to me. Will look in to it.
1

The best solution (in my opinion) is to have an XML file in each folder (as per your original thoughts) that describes the grouping . You could make the file hidden, so that the users are not aware of it, or maybe the XML file could be stored in IsolatedStorage if the grouping is on a per0user basis

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.