views:

243

answers:

4

I've been working on a tagging program for my computer. I need to the ability to pass a list of files or folders into an explorer (or something similar) to display them and be able to manipulate them much like you would do with a folder view in Windows.

I've already written the software which records and stores tags relative to file's path on the computer, and I can search through them dynamically creating a list of paths, but the next part I'm a little stumped on.

Even if there is a solution where I fool the operating into thinking the files are within a "temp" folder and simply display that, that would be perfect.

I'm written everything in C# so far, but I am not picky on the language.

Thanks in advance!

A: 

Create your own directory viewer. However, it will be quite a challenging and time/money consuming task.

Variant 2:

Create catalog with all your tagged tree structure (use links to all real files or just some id-s).

Show it in explorer.

Track changes in that catalog and do following changes in with your tagged data.

Mihail
So why would you suggest he do this?
John Saunders
Cause I don't see any simplier solution. Except creating plug-in to Total Commander)
Mihail
Varient 1 was the one I have been trying to accomplish. However it is difficult to recreate the spit and polish put into Windows Explorer, expicially it being a personal project. By creating a catalog, you mean copying all the files over into a temporay directory and having explorer go to that directory? It would work, but it seems like alot of overkill to solve this problem. Also this program will be tagging my media server, which has terabytes of 600+ mb files on it, so I expect this method to perform poorly.
Not to copy file - create links, or whatever you want.
Mihail
A: 

Sure you could create also temporary folders containing links to your tagged files and then embedding a explorer-control in your app which you could then let navigate to "file://c/temp/mytaggedfolder" or similar but..

What about simply add all data to a listView? There is lot of example code for that on codeproject for example.

codymanix
A: 

do a search for IShellFolder and IShellView. for example: http://www.codeproject.com/KB/shell/explorer.aspx

the interfaces are not especially simple to use, but not especially difficult either and they're quite powerful. from your description it sounds exactly like what you need to essentially host explorer's view within your app, point it at both the real filesystem and/or a custom namespace, and then customize/override the behavior.

~jewels

Jewel S
+1  A: 

IExplorerBrowser control is the native interface for using the "Windows Explorer" control. This has been wrapped in a .NET way in Windows API Code Pack for .NET framework (http://code.msdn.microsoft.com/WindowsAPICodePack)

You could start by using that control (there is a WPF and winforms version, with events, collections you can bind to, tons of properties/flags to set, etc).

If that doesn't give you the desired control, you can move on to the actual Shell objects. The library above also provides access different types of Shell objects- files, folders, virtual items such as control panel, other known folders, etc. You can look at their Shell samples and see the usage.

In short, you can use a ListBox-like control in your app and display the types of files/folders (anything that is represented in Shell). You can also get rich information about each object, like their thumbnail/icon, properties, etc.

Keeron