WinForm there is
AfterSelect event is private field
Delete key is event handler implemented that interacts data access layer :
selectedFolder is passed as parameter to method
DeleteFolder. The selected node of
TreeView is also removed
Code has following issue: it works properly only if
DeleteFolder called first:
selectedFolder) // selectedFolder is OK
If I try :
AfterSelectis called. selectedFolder is now parent node
selectedFolder) // selectedFolder is wrong
As I mentioned this code has bad smell. Is not it?
Should I make
Pull down refactoring to make
selectedFolder local variable.
AfterSelect event handler should be removed.
selectedFolderlocal var based on selected node (code from
In this case is not depended on call order of