-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Code Quality: Rename & Refactor ViewModels #12380
Conversation
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.
Here are some suggestions. Hope I've not been too picky...
When there are naming issues, I added just one comment per file
I'll probably need to re-review this once you finish
Thank you again for your huge work on refactoring
{ | ||
if (FolderSettings is FolderSettingsViewModel viewModel) | ||
if (FolderSettings is FolderSettingsService viewModel) | ||
viewModel.DirectorySortOption = value; |
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.
Shouldn't you rename the variable from viewModel
to simply model
?
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 will fix.
CurrentInstanceViewModel InstanceViewModel { get; } | ||
CurrentInstanceModel InstanceViewModel { get; } |
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.
As above
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.
What do you mean? I changed the suffix to Model. If you mean you are pointing variable naming, I font change yet because those previous viewmodels are referenced everywhere. Once I changed class name, diff became huge.(As i clarified in my cleaning up issue, it will be stage2:)
var isSystem = ((SystemIO.FileAttributes)findData.dwFileAttributes & SystemIO.FileAttributes.System) == SystemIO.FileAttributes.System; | ||
var isHidden = ((SystemIO.FileAttributes)findData.dwFileAttributes & SystemIO.FileAttributes.Hidden) == SystemIO.FileAttributes.Hidden; |
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.
Isn't it System.IO
?
public ItemViewModel(FolderSettingsViewModel folderSettingsViewModel) | ||
public ItemViewModel(FolderSettingsService folderSettingsViewModel) |
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.
Variable name
{ | ||
public static string LayoutSettingsDbPath | ||
=> SystemIO.Path.Combine(ApplicationData.Current.LocalFolder.Path, "user_settings.db"); | ||
private IUserSettingsService UserSettingsService { get; } = Ioc.Default.GetRequiredService<IUserSettingsService>(); |
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 don't you inject it in the constructor?
|
||
public FolderSettingsService() | ||
{ |
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.
Spacing
I have to split up more and more. Reopening. |
there was extra work... |
Description
As the title. Phase 1-2, it is actually a part of the phase 1.
PR Checklist
Related Code Quality: Continued work to clean up entire project #12340
Screenshots
None