Click here to Skip to main content
14,267,437 members

.NET Framework

 
PinnedHOW TO ANSWER A QUESTION Pin
Chris Maunder16-Jul-09 3:09
adminChris Maunder16-Jul-09 3:09 
PinnedHow to get an answer to your question Pin
Chris Maunder16-Jul-09 3:05
adminChris Maunder16-Jul-09 3:05 
QuestionOptimize Directory Parsing and TreeView Population Pin
Harley Burton13-Aug-19 3:16
memberHarley Burton13-Aug-19 3:16 
AnswerRe: Optimize Directory Parsing and TreeView Population Pin
Richard Deeming13-Aug-19 3:51
mveRichard Deeming13-Aug-19 3:51 
GeneralRe: Optimize Directory Parsing and TreeView Population Pin
Harley Burton13-Aug-19 10:41
memberHarley Burton13-Aug-19 10:41 
GeneralRe: Optimize Directory Parsing and TreeView Population Pin
Richard Deeming13-Aug-19 22:35
mveRichard Deeming13-Aug-19 22:35 
Harley Burton wrote:
One small typo in the second foreach block if anyone is using this. (file, and f names)

Thanks - I've fixed the typo. Smile | :)

Harley Burton wrote:
Used a separate thread for ParseProfile

If you're running it from a background thread, you might need to Invoke the methods that manipulate the tree.
How to: Make thread-safe calls to Windows Forms controls | Microsoft Docs[^]
Eg:
TreeNode this_node = (TreeNode)Invoke((Func<TreeNode, DirectoryInfo, TreeNode>)((p, d) => p.Nodes.Add(d.FullName, d.Name, 0)), parent_node, dir);
and:
Invoke((Action<TreeNode, FileInfo>)((p, f) => p.Nodes.Add(f.FullName, f.Name, 1)), parent_node, file);


Harley Burton wrote:
I still have the issue when I expand the root node in the TreeView, but I think the only way I'm going to make that act any better is to populate the treeview as needed when nodes are expanded.

I'd agree with that - populate a single level at a time when a directory node is expanded. You'll obviously need to add a "dummy" node to each directory node so that you can expand it. Smile | :)
TreeView.BeforeExpand Event (System.Windows.Forms) | Microsoft Docs[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: Optimize Directory Parsing and TreeView Population Pin
Harley Burton14-Aug-19 4:52
memberHarley Burton14-Aug-19 4:52 
QuestionWindows Service Installer Problem Pin
Kevin Marois7-Aug-19 6:14
professionalKevin Marois7-Aug-19 6:14 
AnswerRe: Windows Service Installer Problem Pin
Richard Andrew x647-Aug-19 11:47
professionalRichard Andrew x647-Aug-19 11:47 
GeneralRe: Windows Service Installer Problem Pin
Kevin Marois7-Aug-19 12:13
professionalKevin Marois7-Aug-19 12:13 
Question.Net Core web tiff vieawer Pin
Member 145516927-Aug-19 3:55
memberMember 145516927-Aug-19 3:55 
AnswerRe: .Net Core web tiff vieawer Pin
Richard MacCutchan7-Aug-19 4:14
protectorRichard MacCutchan7-Aug-19 4:14 
GeneralRe: .Net Core web tiff vieawer Pin
Member 145516927-Aug-19 4:31
memberMember 145516927-Aug-19 4:31 
GeneralRe: .Net Core web tiff vieawer Pin
Richard MacCutchan7-Aug-19 5:55
protectorRichard MacCutchan7-Aug-19 5:55 
AnswerRe: .Net Core web tiff vieawer Pin
Richard Deeming7-Aug-19 9:44
mveRichard Deeming7-Aug-19 9:44 
QuestionInstalling A Windows Service on Win 10 With Windows Defender Pin
Kevin Marois6-Aug-19 7:23
professionalKevin Marois6-Aug-19 7:23 
AnswerRe: Installing A Windows Service on Win 10 With Windows Defender Pin
Richard Andrew x646-Aug-19 12:13
professionalRichard Andrew x646-Aug-19 12:13 
SuggestionRe: Installing A Windows Service on Win 10 With Windows Defender Pin
Richard Deeming7-Aug-19 9:40
mveRichard Deeming7-Aug-19 9:40 
QuestionHow to crystal report Short by Month.Year Pin
NSE India5-Aug-19 22:08
memberNSE India5-Aug-19 22:08 
AnswerRe: How to crystal report Short by Month.Year Pin
Richard Andrew x646-Aug-19 12:23
professionalRichard Andrew x646-Aug-19 12:23 
AnswerRe: How to crystal report Short by Month.Year Pin
Richard Deeming7-Aug-19 9:38
mveRichard Deeming7-Aug-19 9:38 
QuestionFind Assembly Dependancies Pin
Kevin Marois1-Aug-19 7:17
professionalKevin Marois1-Aug-19 7:17 
AnswerRe: Find Assembly Dependencies Pin
Richard Deeming1-Aug-19 9:05
mveRichard Deeming1-Aug-19 9:05 
QuestionUsing a GAC-registered assembly in a web application Pin
tiwal23-Jul-19 0:39
membertiwal23-Jul-19 0:39 
AnswerRe: Using a GAC-registered assembly in a web application Pin
Eddy Vluggen23-Jul-19 1:13
mveEddy Vluggen23-Jul-19 1:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.