-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
dev/lubl/storage-enum #8405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev/lubl/storage-enum #8405
Conversation
private IntPtr hFile; | ||
private WIN32_FIND_DATA findData; | ||
|
||
public string WorkingDirectory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put it in BaseListedLayoutViewModel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would complement what's in that view model. We just needed some way to have the path be tied to the service instance in order to enable checking if that service is supported for the file system location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the "working directory" name doesn't sound right, we can always change it for the service. It could make sense to change it to reflect that it's tied to a particular instance of the service instead of an app navigation related construct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not pass the path as a parameter? E.g Enumerate(string folderPath) / IsSupported(string folderPath)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! That'd make it much more flexible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no real reason why we should keep the service in know of the current directory. The sole purpose of services is to process the provided data and return appropriate results. It shouldn't really know of the state of the navigated directory. There are some services which may know particular states, but this doesn't apply here. My intent was to create an abstract way directories are traversed, and so these enumerating services should only be supplied with desired path and should only supply back the result. There's no need to incorporate the current directory path nor any contextual data. That would be done in BaseListedLayout
(or ListingModel
) and shall be enough.
@duke7553
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the other hand, I'm still thinking whether to make it transient or singleton. If we use the transient, we'll obviously be able to use the contextual data, but that's not my intent. The question is, how will the service behave with multithreading - will singleton affect it? (As of now, the service is injected as transient)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I'll close this then while we work out that detail.
I'll work on it next week 🙂 |
TBA
For #7540