Intelligent Directory Tree control

  • Thread starter Thread starter _DS
  • Start date Start date
D

_DS

Problem with mapping a directory tree to a tree control: It takes a
while to recurse subdirs and map them to nodes. This is solved in
some books I've seen (MacDonald, Albahari) by reading the subdir only
when its node on the tree control is opened.

Has anyone pre-packaged this functionality into a control?
 
Most 3rd party tree controls for .Net 1.x have support for "Node_Click"
events which support this. If I'm not mistaken, the tree control in .Net 2.0
has this functionality as well.
 
Problem with mapping a directory tree to a tree control: It takes a
while to recurse subdirs and map them to nodes. This is solved in
some books I've seen (MacDonald, Albahari) by reading the subdir only
when its node on the tree control is opened.

Has anyone pre-packaged this functionality into a control?

I appreciate the followup re tree nodes. I did know how to populate
the tree; I've done that before. However, mapping a tree to a
directory structure can get complex, so I was wondering if anyone had
a custom control that handled any of the following:

File system monitor: For updating the tree in the background.
Would help to prevent faults when the file system was changed.

'Just In Time' population of tree nodes: Building the tree from a
large directory structure takes a lot of time. Better to build
it dynamically as nodes are opened. Code for this exists in
the references that I mentioned, but not as an integral part of
a custom control.

Threaded update: This could populate the tree in the background.
After setting up the top level nodes (like 'Just in Time'
above), the thread could work on the other nodes. This could
be combined with the JIT operation, in case the user got ahead
of the background thread by descending into one node before the
thread got there.

Those are just a few that I thought of. Seems like this is a general
purpose kind of control. Does anything like this exist already?
 
File system monitor: For updating the tree in the background.
Would help to prevent faults when the file system was changed.
Look at threading within the UI. Not sure what you mean by "faults"... When
a file or directory is deleted/added?
Just a thought, but why update until it is needed(see below)?
'Just In Time' population of tree nodes: Building the tree from a
large directory structure takes a lot of time. Better to build
it dynamically as nodes are opened. Code for this exists in
the references that I mentioned, but not as an integral part of
a custom control.

The node_expand/node_click event on most tree controls handle this, though
its not "included", you, the developer needs to control the level of
recursion. If you need to control the depth of expansion, inherit from the
control, add a property, check when its met and you're done. Do you really
want to recurse a directory in the background a user isn't going into?
Windows doesn't.
Threaded update: This could populate the tree in the background.
After setting up the top level nodes (like 'Just in Time'
above), the thread could work on the other nodes. This could
be combined with the JIT operation, in case the user got ahead
of the background thread by descending into one node before the
thread got there.

'Just in Time', as I understand it means 'On Demand', which in end-user
language means 'when I click'. That said, why load more than what the user
is really asking for? Even Windows is 'load on demand', with background
refresh. What is it you're trying to prevent? Changes, Additions, Deletions?
Are you doing anything with the files/directories or just presenting them?
 
Back
Top