I have a treeview and it's used for managing the folders/programs in a systray program launcher I made. I wanted to add a way to move multiple programs to other parent folders easily. I figured no big deal, I'll make the TreeView allow multiple selection, that's not an issue right? Welllll apparently it is. So I figured OK, I'll build a little popup window that asks you to select the parent for the items then have a listbox that shows all the available nodes and you select what you want. Easy peasy.
However... I can't figure out the right way to build my listbox items. Say I have a treeview with these nodes:
- Apps
- |__FileZilla
- |__Outlook
- Media
- |__Photoshop
- |__Audacity
- |__Video
- |__ZoomPlayer
- |__VLC
- Apps\FileZilla
- Apps\Outlook
- Media\Photoshop
- Media\Audacity
- Media\Video\ZoomPlayer
- Media\Video\VLC
Each TreeNode's Tag is a wrapper "Node" which has a property to determine if it's a folder or a program. I figure I can check that as I iterate the nodes and check if ((Node)treeNode.Tag).NodeClass == NodeClasses.Folder then I know I don't have to add it to the listbox.
Can someone assist? Thanks!
PS on a tangent here, but out of curiosity... that NodeClasses enum, my Java teacher said enum properties should be UPPERCASE. I see in most code examples in C# they are PascalCase. Is that the accepted standard for C#? I really don't like all caps so I avoided it. Just curious if that's against naming conventions or not.
KenPosted May 4, 2021, 5:02 AM
KenPosted May 3, 2021, 8:46 PM
Jignesh KumarPosted May 3, 2021, 3:33 PM